home *** CD-ROM | disk | FTP | other *** search
/ Mac-Source 1994 July / Mac-Source_July_1994.iso / Other Langs / Tickle-4.0 (tcl) / tcl / expecTerm / tinfo.c < prev    next >
Encoding:
Text File  |  1993-11-17  |  91.1 KB  |  2,492 lines  |  [TEXT/MPS ]

  1. /* tinfo.c
  2. **************************************************************************** 
  3. expecTerm version 1.0 beta
  4. Mark Weissman
  5. Christopher Matheus
  6. Copyright 1992 by GTE Laboratories Incorporated.
  7.  
  8. Portions of this work are in the public domain.  Permission to use,
  9. copy, modify, and distribute this software and its documentation for
  10. any purpose and without fee is hereby granted, provided that the above
  11. copyright notice appear in all copies and that both the copyright
  12. notice and warranty disclaimer appear in supporting documentation, and
  13. that the names of GTE Laboratories or any of their entities not be
  14. used in advertising or publicity pertaining to distribution of the
  15. software without specific, written prior permission.
  16.  
  17. GTE disclaims all warranties with regard to this software, including
  18. all implied warranties of merchantability and fitness for a particular
  19. purpose, even if GTE Laboratories Incorporated knows about the
  20. purpose.  In no event shall GTE be liable for any special, indirect or
  21. consequential damages or any damages whatsoever resulting from loss of
  22. use, data or profits, whether in an action of contract, negligence or
  23. other tortuous action, arising out of or in connection with the use or
  24. performance of this software.
  25.  
  26. This code is based on and may include parts of Don Libes' expect code:
  27.   expect written by: Don Libes, NIST, 2/6/90
  28.   Design and implementation of expect was paid for by U.S. tax
  29.   dollars.  Therefore it is public domain.  However, the author and NIST
  30.   would appreciate credit if this program or parts of it are used.
  31. *****************************************************************************
  32.  
  33. Written by: Mark Weissman 9/1992
  34. */
  35.  
  36. /* #define DEBUG_SMARTHASH 1 */
  37. /* #define DEBUG_TERMFUNCS 1 */
  38. Break() {}
  39. #include "compat.h"
  40. #include "win.h"
  41. #include "termfuncs.h"
  42. extern char Nextch();
  43. extern double NextchInputWait;
  44. extern long Arg[], Argno, Vars[];
  45.  
  46. #ifndef TRUE
  47. #define TRUE 1
  48. #endif
  49. #ifndef FALSE
  50. #define FALSE 0
  51. #endif
  52.  
  53. #define CLOBBER_OLD_VAL 0
  54.  
  55. #define TBOOL   "boolean"
  56. #define TNUM    "number"
  57. #define TSTRING "string"
  58. #define TINFO   "infoString"
  59.  
  60. typedef struct Entry_Struct {
  61.   char *terminfo, *termcap, *name, *access, *type, *doc;
  62.   void (*func)();
  63. } Entry;
  64. static Entry *Entries = NULL;
  65. #define EntryToIndex(ENTRY) (ENTRY - Entries)
  66. #define ENTRY(INDEX) (Entries + INDEX)
  67. #define EntryINC 256
  68. static long EntryCurr=1, EntryMax=0;
  69. TermTab *CurrTerm;
  70.  
  71. typedef struct Nodetruct {
  72.   char first, last;
  73.   short int entry;
  74.   union {
  75.     short int *children;
  76.     short int child;
  77.   } u;
  78. } Node;
  79. static Node *Nodes = NULL;
  80. #define NODE(INDEX) (Nodes + INDEX)
  81. #define NodeToIndex(NODE) (NODE - Nodes)
  82. #define NodeINC 256
  83. static int NodeMax = 0, NodeCurr = 1;
  84.  
  85. static short int EscSeqTab=0;
  86. char *ExpectLogDir, *ExpectDir;
  87.  
  88. char *FixEscapes(buf, from) 
  89. char *buf, *from;
  90. {
  91.   char *to = buf;
  92.   if (!from) return("*UNKNOWN ESCAPE SEQUENCE*");
  93.   while (*from) {
  94.     if (*from < ' ') { *to++ = '^'; *to++ = *from++ + 'A' - ''; }
  95.     else *to++ = *from++;
  96.   }
  97.   *to='\0';
  98.   return(buf);
  99. }
  100.  
  101.  
  102. char *CleanKey(s)
  103. char *s;
  104. {
  105.   static char pbuf[256], *p;
  106.   int tot;
  107.   p=pbuf;
  108.   for(p=pbuf; *s; ++s) {
  109.     switch (*s) {
  110.     case '$': while(*s && (*s++ != '>')); *p++ = *s; break;
  111.     case '{': for(tot=0; *s && (*s != '}'); tot = (tot*10)+(*s - '0'), ++s); *p++ = tot; break;
  112.     case '\'':
  113.       { switch(*(++s)) {
  114.     case '\\':
  115.       switch(*(++s)) {
  116.       case 'n': *p = '\n'; break;
  117.       case 'l': *p = ' '; break;
  118.       case 'r': *p = '\r'; break;
  119.       case 't': *p = '\t'; break;
  120.       case 'b': *p = '\b'; break;
  121.       case 'f': *p = '\f'; break;
  122.       case 's': *p = ' '; break;
  123.       case '0': *p = (8*(*(++s)-'0') + (*(++s)-'0')); break;
  124.       case '1': *p = (8*(*(++s)-'0') + (*(++s)-'0')) + 64; break;
  125.         /* The following case strips off 8th bit!!! */
  126.       case '2': *p = (8*(*(++s)-'0') + (*(++s)-'0')); break;
  127.       case 'e': 
  128.       case 'E': *p = ''; break;
  129.       }
  130.       break;
  131.     case '^': 
  132.       ++s;
  133.       *p = *s - ((*s>='a'&&*s<'z')?'`':'@'); break;
  134.     default:    *p = *s; break;
  135.     }
  136.     ++p; ++s;
  137.       } break; /* case '\'' */
  138.     default: *p++ = *s; break;
  139.     }
  140.   }
  141.   *p = '\0';
  142.   return(pbuf);
  143. }
  144.  
  145. long ParseConditional(s,tbuf,ebuf)
  146. char *s, *tbuf, *ebuf;
  147. {
  148.   char *s0 = s, *os = s;
  149. /*  char ntbuf[256], nebuf[256]; */
  150.   char *ntbuf= NULL, *nebuf = NULL;
  151.   int result = 1;
  152.   static char *indent = "\t\t\t\t\t\t\t\t", *i= NULL;
  153.   if (!i) i=indent+8;
  154.  
  155.   if (*s && ('%'==*s) && ('?'==*(s+1))) {
  156.     --i;
  157.     os = s+2;
  158.     if (tbuf) *tbuf = '\0'; 
  159.     if (ebuf) *ebuf = '\0';
  160.     for(s=os; !(('%'==*s) && ('t'==*(s+1))); s += ParseConditional(s,ntbuf,nebuf));
  161.     if (tbuf) { strncpy(tbuf,os,(s-os)); tbuf[s-os] = '\0'; }
  162.     os = s+2;
  163.     for(s=os; !(('%'==*s) && (*(s+1)=='e' || *(s+1)==';')); s += ParseConditional(s,ntbuf,nebuf));
  164.     if (tbuf) { int l=strlen(tbuf); strncpy(tbuf+l,os,(s-os)); tbuf[s-os+l] = '\0'; }
  165.     if (('%'==*s) && ('e'== *(s+1))) {
  166.       os = s+2;
  167.       for(s=os; !(('%'==*s) && (*(s+1)==';')); s += ParseConditional(s,ntbuf,nebuf));
  168.       if (ebuf) { strncpy(ebuf,os,(s-os)); ebuf[s-os] = '\0'; }
  169.     }
  170.     s+=2;
  171.     if (ebuf) strcat(ebuf,s);
  172.     if (tbuf) strcat(tbuf,s);
  173.     result = (s-s0);
  174.     ++i;
  175. /*    fprintf(stderr, "%sS: \"%s\", ebuf: \"%s\", tbuf: \"%s\"\n", i, s0, ebuf, tbuf); fflush(stderr); */
  176.   }
  177.   return(result);
  178. }
  179.  
  180. Entry *NewEntry(stream, terminfo, termcap, type, access, func, name, doc)
  181. FILE *stream;
  182. char *terminfo, *termcap, *name, *access, *doc, *type;
  183. void (*func)();
  184. {
  185.   Entry *new;
  186.   if (!func && *type == *TSTRING) return(NULL);
  187.   if (EntryCurr >= EntryMax) {
  188.     Entry *old = Entries;
  189.     int n;
  190.     Entries = (Entry *)calloc(EntryMax+EntryINC, sizeof(Entry));
  191.     for(n=0; n < EntryMax; ++n) {
  192.       Entries[n].terminfo   = old[n].terminfo;
  193.       Entries[n].termcap    = old[n].termcap;
  194.       Entries[n].name       = old[n].name;
  195.       Entries[n].access     = old[n].access;
  196.       Entries[n].func       = old[n].func;
  197.       Entries[n].type       = old[n].type;
  198.       Entries[n].doc        = old[n].doc;
  199.     }
  200.     if (old) free(old);
  201.     EntryMax += EntryINC;
  202.   }
  203.   new = (Entries + EntryCurr++);
  204.   new->terminfo = terminfo;
  205.   new->termcap = termcap;
  206.   new->doc = doc;
  207.   new->name = name;
  208.   new->func = func;
  209.   new->type = type;
  210.   return(new);
  211. }
  212. Entry *TerminfoToEntry(name)
  213. char *name;
  214. {
  215.   int i;
  216.   for(i=1; i<EntryCurr; ++i) if (!strcmp(name,ENTRY(i)->terminfo)) return(ENTRY(i));
  217.   return(NULL);
  218. }
  219. Entry *FuncToEntry(func)
  220. FPTR func;
  221. {
  222.   int i;
  223.   for(i=1; i<EntryCurr; ++i) if (func==ENTRY(i)->func) return(ENTRY(i));
  224.   return(NULL);
  225. }
  226.  
  227. short int NewNode()
  228. {
  229.   if (NodeCurr >= NodeMax) {
  230.     Node *old = Nodes;
  231.     int n;
  232.     Nodes = (Node *)calloc(NodeMax+NodeINC, sizeof(Node));
  233.     for(n=0; n < NodeMax; ++n) {
  234.       Nodes[n].first   = old[n].first;
  235.       Nodes[n].last    = old[n].last;
  236.       Nodes[n].entry   = old[n].entry;
  237.       Nodes[n].u.children = old[n].u.children;
  238.     }
  239.     if (old) free(old);
  240.     NodeMax += NodeINC;
  241.   }
  242.   NODE(NodeCurr)->first = -1;
  243.   return(NodeCurr++);
  244. }
  245.  
  246. short int Child(node,i)
  247. short int node;
  248. char i;
  249. {
  250.   Node *n = NODE(node);
  251.   short int first = n->first;
  252.   short int last  = n->last;
  253.   short int *children = n->u.children;
  254.   return (!children
  255.       ? 0
  256.       : ((first == i && last == i)
  257.          ? n->u.child
  258.          : ((first <= i && last >= i)
  259.         ? ((children[i-first] > 0)
  260.            ? children[i-first]
  261.            : 0)
  262.         : 0)
  263.          )
  264.       );
  265. }
  266.  
  267. short int GetChildNode(node, s)
  268. short int node;
  269. char *s;
  270. {
  271.   short int i;
  272.   short int child;
  273.   
  274.   if (!node) return(NULL);
  275.   child = Child(node, *s);
  276.   if (child) return(child);
  277.   child = NewNode();
  278.   if (!NODE(node)->u.children) {
  279.     NODE(node)->first = NODE(node)->last = *s;
  280.     NODE(node)->u.child = child;
  281.   }
  282.   else if (*s < NODE(node)->first || *s > NODE(node)->last) {
  283.     short int *children;
  284.     int newstart  = (*s < NODE(node)->first) ? *s : NODE(node)->first;
  285.     int newend    = (*s > NODE(node)->last)  ? *s : NODE(node)->last;
  286.     int childrange  = NODE(node)->last - NODE(node)->first;
  287.     if (NODE(node)->first == NODE(node)->last)
  288.       *(children = (short int *)calloc(1, sizeof(short int))) = NODE(node)->u.child;
  289.     else 
  290.       children = NODE(node)->u.children;
  291.     NODE(node)->u.children = (short int *)calloc((newend - newstart + 1), sizeof(short int));
  292.     for (i=0; i<=childrange; ++i) NODE(node)->u.children[i + NODE(node)->first - newstart] = children[i];
  293.     free(children);
  294.     NODE(node)->last  = newend;
  295.     NODE(node)->first = newstart;
  296.     NODE(node)->u.children[*s - NODE(node)->first] = child;
  297.   } 
  298.   else NODE(node)->u.children[*s - NODE(node)->first] = child;
  299.   return(child);
  300. }
  301.  
  302. char *SetHash(stream, node, s, entry)
  303. FILE *stream;
  304. short int node;
  305. char *s;
  306. Entry *entry;
  307. {
  308.   static long depth = 0;
  309.   static char seq[BUFSIZ];
  310.   extern char *Strdup();
  311.  
  312.   if ((*s == '%') && (*(s+1)=='?')) { 
  313.     char tbuf[256], ebuf[256], *r1, *r2;
  314.     ParseConditional(s,tbuf,ebuf);
  315.     r1 = SetHash(stream, node, tbuf, entry);
  316.     r2 = SetHash(stream, node, ebuf, entry);
  317.     return(r1 ? r1 : r2);
  318.   }
  319.   if (depth == 0) {
  320.     if ((*s >= ' ') && (*s <= '~')) return(NULL);
  321.     s = CleanKey(s);
  322.   } else if (depth == 256) { fatal("Too Deep in SetHash"); exit(-1); }
  323.   seq[depth] = *s; seq[depth+1] = '\0';
  324.   if (*s) {
  325.     short int child = GetChildNode(node, s);
  326.     char *r;
  327.     ++depth; r=SetHash(stream, child, s+1, entry); --depth;
  328.     return(r);
  329.   }
  330.   if (stream && NODE(node)->entry && Entries[NODE(node)->entry].func != entry->func) {
  331.     Entry *oentry = ENTRY(NODE(node)->entry);
  332.     fprintf(stream,",\n# Escape Sequence Clash: (Keep %s)",(CLOBBER_OLD_VAL?"New":"Old"));
  333.     fprintf(stream,",\n#   Old Cap: %-8s, Function: %s, Sequence: \"%s\"",
  334.         oentry->terminfo, oentry->name, FixEscapes(Buffer,oentry->access));
  335.     fprintf(stream,",\n#   New Cap: %-8s, Function: %s, Sequence: \"%s\"",
  336.         entry->terminfo,  entry->name, FixEscapes(Buffer,seq));
  337.     fflush(stream);
  338.   }
  339.   if (!NODE(node)->entry || CLOBBER_OLD_VAL) {
  340.     char buf[BUFSIZ];
  341.     NODE(node)->entry = EntryToIndex(entry);
  342.     if (entry->access) free(entry->access);
  343.     entry->access = Strdup(seq);
  344.     if (stream) {
  345.       fprintf(stream,",\n# %-8s\n    %-32s=%-s", entry->name, entry->terminfo, FixEscapes(buf,seq));
  346.       fflush(stream);
  347.     }
  348.     return(entry->terminfo);
  349.   }
  350.   else return(NULL);
  351. }
  352.  
  353. ShowTermCapabilities(stream, type)
  354. FILE *stream;
  355. char *type;
  356. {
  357.   int e = 0;
  358.   for(e=1; stream && e < EntryCurr; ++e) {
  359.     Entry *entry = &Entries[e];
  360.     if (*entry->type == *type) {
  361.       if (*entry->type == *TSTRING) {
  362.     fprintf(stream,",\n# %s\n# %-8s: %-s", entry->doc, entry->terminfo, FixEscapes(Buffer,entry->access));
  363.     fflush(stream);
  364.       }
  365.       else if (*entry->type == *TINFO) {
  366.     switch ((int)entry->access) {
  367.     case -1: case 0:
  368.       fprintf(stream,",\n# INFO: %-8s\n#    %-32s=", entry->doc, entry->terminfo);
  369.       break;
  370.     default:
  371.       fprintf(stream,",\n# INFO: %-8s\n    %-32s=%-s", entry->doc, entry->terminfo, FixEscapes(Buffer,entry->access));
  372.       break;
  373.     }
  374.     fflush(stream);
  375.       }
  376.       else if (*entry->type == *TNUM) {
  377.     fprintf(stream,  ",\n# %s\n%s#%-d", entry->doc, entry->terminfo, entry->access);
  378.     fflush(stream);
  379.       }
  380.       else if (*entry->type == *TBOOL) {
  381.     switch ((int)entry->access) {
  382.     case 0: 
  383.       fprintf(stream,",\n# %s\n%s@", entry->doc, entry->terminfo);
  384.       break;
  385.     case 1: 
  386.       fprintf(stream,",\n# %s\n%s",  entry->doc, entry->terminfo);
  387.       break;
  388.     default:
  389.       fprintf(stream,",\n# %s\n# %s = %d", entry->doc, entry->terminfo, entry->access);
  390.       break;
  391.     }
  392.     fflush(stream);
  393.       }
  394.       else {
  395.     sprintf(Buffer, "Unknown t->type: %s\n",entry->type);
  396.     fatal(Buffer);
  397.     exit(-1);
  398.       }
  399.     }
  400.   }
  401. }
  402.  
  403. DumpHashTab(stream,node) 
  404. FILE *stream;
  405. short int node;
  406. {
  407.   static long depth = 0;
  408.   static char seq[BUFSIZ];
  409.   char buf[BUFSIZ];
  410.   char c;
  411.  
  412.  
  413.   if (!stream || !NODE(node)->u.children) return;
  414.   if (!depth && stream) fprintf(stream,",\n# Dumping Sequence Table");
  415.  
  416.   for (c = NODE(node)->first; c <= NODE(node)->last; ++c) {
  417.     int child = Child(node,c);
  418.     if (child) {
  419.       seq[depth] = c;
  420.       seq[depth+1]='\0';
  421.       if (NODE(child)->entry) {
  422.     Entry *entry = ENTRY(NODE(child)->entry);
  423.     fprintf(stream,",\n# %-8s\n    %-32s=%-s", entry->name, entry->terminfo, FixEscapes(buf,seq));
  424.     fflush(stream);
  425.       }
  426.       ++depth;
  427.       DumpHashTab(stream, child);
  428.       --depth;
  429.     }
  430.   }
  431. }
  432.  
  433.  
  434. #ifdef DEBUG_SMARTHASH
  435. static char *SHSeq="";
  436. #define CharTab(CHAR, TEST) ((child = Child(node, CHAR)) && (TEST))
  437. #define CacheSeq() char *oseq = SHSeq
  438. #define BindTab(CHAR) \
  439. register short int node = child; \
  440. CacheSeq(); \
  441. char seq[BUFSIZ]; \
  442. if (CHAR<' ') sprintf(seq, "%s^%c", oseq, (CHAR+'@')); else sprintf(seq,"%s%c",oseq,CHAR); \
  443. SHSeq=seq;
  444. #define RestoreTab() SHSeq=oseq
  445. #define WithCharTable(CHAR, TEST, BODY) if (CharTab(CHAR,TEST)) {BindTab(CHAR); BODY; RestoreTab();}
  446. #else
  447. #define CacheSeq() NULL
  448. #define CharTab(CHAR, TEST) ((child = Child(node, CHAR)) && (TEST))
  449. #define BindTab(CHAR) register short int node = child;
  450. #define RestoreTab() NULL
  451. #define WithCharTable(CHAR, TEST, BODY) if (CharTab(CHAR,TEST)) {BindTab(CHAR); BODY; RestoreTab();}
  452. #endif
  453.  
  454. static char *EndPtr;
  455.  
  456. FPTR SmartHash(node, s, pop)
  457. register short int node;
  458. char *s;
  459. long *pop;
  460. {
  461.   FPTR r = NULL;
  462.   char *c;
  463.   register short int child; /* temporary used in WithCharTable */
  464.  
  465. #ifdef DEBUG_SMARTHASH
  466.   static int depth=0;
  467.   CacheSeq();
  468.   ++depth;
  469. #endif
  470.   
  471.   
  472.   if (!node || !s) fatal("Bad Args to SmartHash");
  473.   if (!*s && NODE(node)->u.children && Nextch(NextchInputWait, s)) *(s+1)='\0';
  474.   
  475. #ifdef DEBUG_SMARTHASH
  476.   {
  477.     static char space[BUFSIZ];
  478.     char buf[BUFSIZ];
  479.     int sp;
  480.     for (sp=0; sp < depth; ++sp) space[sp]='|'; space[sp]='\0';
  481.     fprintf(stderr, "%s%d SmartHash(node:%3d, s:\"%s\", pop:0x%d=%d:'%c') seq:\"%s\"\n", 
  482.         space, depth, node, s, pop, *pop, ((*pop<256)?(char)*pop:'?'), SHSeq); 
  483.     fprintf(stderr, "%s%s a0: %d, a1: %d, a2: %d a3: %d a4: %d\n", space, (depth>9?"  ":" "), 
  484.         Arg[0], Arg[1], Arg[2], Arg[3], Arg[4]);
  485.   }
  486. #endif
  487.  
  488.   if (!*s && NODE(node)->entry) { EndPtr=s; r=Entries[NODE(node)->entry].func; goto DONE; }
  489.   else if (!*s) { r = NULL; goto DONE; }
  490.   
  491.   if (CharTab(BYTE7(*s),TRUE)) {
  492.     long npop = BYTE7(*s), opop = *pop;
  493.     BindTab(*s);
  494.     *pop = npop;
  495.     if (r=SmartHash(node, (s+1), &npop)) goto DONE; 
  496.     *pop = opop;
  497.     RestoreTab();
  498.   }
  499.   if (CharTab('%',TRUE)) { 
  500.     BindTab('%');
  501.     if (CharTab('%', (*s == '%'))) { 
  502.       long npop = *s, opop = *pop;
  503.       BindTab('c'); 
  504.       *pop = npop;
  505.       if (r=SmartHash(node, (s+1), &npop)) goto DONE;
  506.       *pop = opop;
  507.       RestoreTab();
  508.     }
  509.     if (CharTab('c', TRUE)) { 
  510.       long npop = BYTE7(*s), opop = *pop;
  511.       BindTab('c'); 
  512.       *pop = npop;
  513.       if (r=SmartHash(node, (s+1), &npop)) goto DONE;
  514.       *pop = opop;
  515.       RestoreTab();
  516.     }
  517.     if (CharTab('s',TRUE)) { 
  518.       static char buf[257], *b; /* This is limited to only one string match !!! */
  519.       long opop = *pop, len = (*pop > 256) ? 256 : *pop; /* Drop Overflow! */
  520.       BindTab('s');
  521.       for (c = s, b = buf; (len-- > 0); ++b, ++c) {
  522.     if (!*c && Nextch(NextchInputWait,c)) *(c+1)='\0';
  523.     *b = BYTE7(*c);
  524.       }
  525.       *b='\0';
  526.       *pop = (long)buf; 
  527.       if (r = SmartHash(node, c, pop)) goto DONE;
  528.       *pop = opop;
  529.       RestoreTab();
  530.     }
  531.     if (CharTab('d',TRUE)) {
  532.       long npop=0, opop = *pop;
  533.       BindTab('d');
  534.       c = s;
  535.       while (*c >= '0' && *c <= '9') {
  536.         npop = ((npop * 10)+(*c - '0'));
  537.     if (!*(++c) && Nextch(NextchInputWait,c)) *(c+1)='\0';
  538.       }
  539.       while ((c > s) && (*s >= '0' && *s <= '9')) {
  540.         *pop = npop;
  541.         if (r=SmartHash(node, c, &npop)) goto DONE;
  542.         --c; npop /= 10;
  543.       }
  544.       *pop = opop;
  545.       RestoreTab();
  546.     }
  547.     if (CharTab('p',TRUE)) {
  548.       BindTab('p');
  549.       for (c="123456789"; *c; ++c) {
  550.     if (CharTab(*c,TRUE)) {
  551.       long argno = (*c - '1'), old = Arg[argno];
  552.       BindTab(*c);
  553.       if (r=SmartHash(node, s, (Arg+argno))) {
  554.         if (argno >= Argno) Argno = argno+1;
  555.         *pop = Arg[argno];
  556.         goto DONE; }
  557.       Arg[argno] = old; 
  558.       RestoreTab();
  559.     }
  560.       }
  561.       RestoreTab();
  562.     }
  563.     if (CharTab('g',TRUE)) {
  564.       BindTab('g');
  565.       for (c="abcdefghijklmnopqrstuvwxyz"; *c; ++c) {
  566.     if (CharTab(*c,TRUE)) { 
  567.       long varno = (*c - 'a'), old = Vars[varno];
  568.       BindTab(*c);
  569.       if (r=SmartHash(node, s, (Vars+varno))) {
  570.         *pop = Vars[varno];
  571.         goto DONE; }
  572.       Vars[varno] = old; 
  573.       RestoreTab();
  574.     }
  575.       }
  576.       RestoreTab();
  577.     }
  578.     if (CharTab('P',TRUE)) { 
  579.       BindTab('P');
  580.       for (c="abcdefghijklmnopqrstuvwxyz"; *c; ++c) {
  581.     if (CharTab(*c,TRUE)) { 
  582.       long npop = Vars[(*c - 'a')];
  583.       BindTab(*c);
  584.       if (r=SmartHash(node, s, &npop)) goto DONE;
  585.       RestoreTab();
  586.     }
  587.       }
  588.       RestoreTab();
  589.     }
  590.     WithCharTable('l',TRUE, if (r=SmartHash(node, s, pop)) goto DONE; );
  591.     WithCharTable('i',TRUE, if (r=SmartHash(node, s, pop)) { Arg[0]--; Arg[1]--; goto DONE;});
  592.     WithCharTable('~',TRUE, if (r=SmartHash(node, s, pop)) { *pop = ~*pop; goto DONE; });
  593.     WithCharTable('!',TRUE, if (r=SmartHash(node, s, pop)) { *pop = !*pop; goto DONE; });
  594.     
  595.     WithCharTable('+',TRUE, { long npop = *pop; if (r=SmartHash(node, s, &npop)) { *pop -= npop; goto DONE;}});
  596.     WithCharTable('-',TRUE, { long npop = *pop; if (r=SmartHash(node, s, &npop)) { *pop += npop; goto DONE;}});
  597.     WithCharTable('*',TRUE, { long npop = *pop; if (r=SmartHash(node, s, &npop)) { *pop /= npop; goto DONE;}});
  598.     WithCharTable('/',TRUE, { long npop = *pop; if (r=SmartHash(node, s, &npop)) { *pop *= npop; goto DONE;}});
  599.     WithCharTable('|',TRUE, { long npop = *pop; if (r=SmartHash(node, s, &npop)) { *pop -= npop; goto DONE;}});
  600.     WithCharTable('O',TRUE, { long npop = *pop; if (r=SmartHash(node, s, &npop)) { *pop -= npop; goto DONE;}});
  601.     WithCharTable('&',TRUE, { long npop = *pop; if (r=SmartHash(node, s, &npop)) { *pop -= npop; goto DONE;}});
  602.     WithCharTable('A',TRUE, { long npop = *pop; if (r=SmartHash(node, s, &npop)) { *pop -= npop; goto DONE;}});
  603.     WithCharTable('^',TRUE, if (r=SmartHash(node, s, pop)) goto DONE);
  604.     WithCharTable('m',TRUE, if (r=SmartHash(node, s, pop)) goto DONE); 
  605.     WithCharTable('<',TRUE, NULL); WithCharTable('>',TRUE, NULL); WithCharTable('=',TRUE, NULL);
  606.     RestoreTab();
  607.   };
  608.   if (NODE(node)->entry) EndPtr=s;
  609.   r = (NODE(node)->entry ? (Entries + NODE(node)->entry)->func : NULL);
  610.  DONE:
  611. #ifdef DEBUG_SMARTHASH
  612.   { static char space[BUFSIZ];
  613.     char buf[BUFSIZ];
  614.     int sp;
  615.     for (sp=0; sp < depth; ++sp) space[sp]='|'; space[sp]='\0';
  616.     fprintf(stderr, "%s%d => [pop:%d:'%c'] r:%s() seq:\"%s\"\n",
  617.         space, depth, *pop, ((*pop<256)?(char)*pop:'?'), (r?FuncToEntry(r)->name:"NULL"), SHSeq);
  618.     fprintf(stderr, "%s%s a0: %d, a1: %d, a2: %d a3: %d a4: %d\n", space, (depth>9?"  ":" "), 
  619.         Arg[0], Arg[1], Arg[2], Arg[3], Arg[4]);
  620.   }
  621.   --depth;
  622. #endif
  623.   RestoreTab();
  624.   return(r);
  625. }
  626.  
  627. char *LookupCap(termtab, cap) 
  628. char *cap;
  629. TermTab *termtab;
  630. {
  631.   Entry *entry = TerminfoToEntry(cap);
  632.   if (!entry) return(NULL);
  633.   if (*entry->type == *TNUM) {
  634.     sprintf(Buffer,"%d", (int)*(int *)(((char *)termtab) + (int)entry->func));
  635.     Buffer[strlen(Buffer)+1] = 'n'; /* Hide Type info after string */
  636.     return(Buffer);
  637.   }
  638.   if (*entry->type == *TBOOL) {
  639.     int b = (int)*(char *)(((char *)termtab) + (int)entry->func);
  640.     if (b != 1 && b != 0) return(NULL);
  641.     sprintf(Buffer,"%d", b);
  642.     Buffer[strlen(Buffer)+1] = 'b'; /* Hide Type info after string */
  643.     return(Buffer);
  644.   }
  645.   if (*entry->type == *TINFO) {
  646.     char *s= *(char **)(((char *)termtab) + (int)entry->func);
  647.     return((s>(char *)0)?s:(char *)NULL);
  648.   }
  649. }
  650.  
  651. char *InstallCapability(stream, cap, code, type, access, func, funcname, doc)
  652. FILE *stream;
  653. void (*func)();
  654. char *cap, *access, *doc, *code, *funcname, *type;
  655. {
  656.   if (*type == *TSTRING) {
  657.     if (func && access) return(SetHash(stream, EscSeqTab, access, TerminfoToEntry(cap)));
  658.     else return(NULL);
  659.   }
  660.   else if (*type == *TNUM) {
  661.     Entry *entry = TerminfoToEntry(cap);
  662.     int *valptr = (int *)((char *)CurrTerm + (int)entry->func);
  663.     if (stream && *valptr != -1 && *valptr != (int)access) {
  664.       fprintf(stream,",\n# %s Value Clash for Cap: %s, (Keep %s)", type, cap, (CLOBBER_OLD_VAL?"New":"Old"));
  665.       fprintf(stream,",\n#   Old Value: %d", *valptr);
  666.       fprintf(stream,",\n#   New Value: %d", (int)access);
  667.       fflush(stream);
  668.     }
  669.     if (*valptr == -1 || (CLOBBER_OLD_VAL && *valptr != (int)access)) {
  670.       if (valptr) *valptr = (int)access;
  671.       if (entry) entry->access = access;
  672.     }
  673.   }
  674.   else if (*type == *TBOOL) {
  675.     Entry *entry = TerminfoToEntry(cap);
  676.     char *valptr = (char *)((char *)CurrTerm + (int)entry->func);
  677.     if (stream && *valptr != (char)-1 && *valptr != (char)access) {
  678.       fprintf(stream,",\n# %s Value Clash for Cap: %s, (Keep %s)", type, cap, (CLOBBER_OLD_VAL?"New":"Old"));
  679.       fprintf(stream,",\n#   Old Value: %d", *valptr);
  680.       fprintf(stream,",\n#   New Value: %d", (int)(char)access);
  681.       fflush(stream);
  682.     }
  683.     if (*valptr == (char)-1 || (CLOBBER_OLD_VAL && *valptr != (char)access)) {
  684.       if (valptr) *valptr = (char)access;
  685.       if (entry) entry->access = access;
  686.     }
  687.   }
  688.   else if (*type == *TINFO) {
  689.     Entry *entry = TerminfoToEntry(cap);
  690.     char **valptr = (char **)((char *)CurrTerm + (int)entry->func);
  691.     if (stream && *valptr != (char *)-1 && (access>(char *)0) && strcmp(*valptr,(char *)access)) {
  692.       fprintf(stream,",\n# %s Value Clash for Cap: %s, (Keep %s)", type, cap, (CLOBBER_OLD_VAL?"New":"Old"));
  693.       fprintf(stream,",\n#   Old Value: \"%s\"", *valptr);
  694.       fprintf(stream,",\n#   New Value: \"%s\"", (char *)access);
  695.       fflush(stream);
  696.     }
  697.     if ((*valptr == (char *)-1) || (CLOBBER_OLD_VAL && (access>(char *)0) && strcmp(*valptr,(char *)access))) {
  698.       if (valptr && *valptr != (char *)-1) { free(*valptr); *valptr = (char *)-1; }
  699.       if (valptr) {
  700.     if (access>(char *)0) {
  701.       *valptr = (char *)malloc(strlen(access)+2);
  702.       strcpy(*valptr,access);
  703.       (*valptr)[strlen(access)+1] = 's';    /* Hide Type info after string */
  704.     }
  705.       }
  706.       if (entry) entry->access = *valptr;
  707.     }
  708.   }
  709. }
  710.  
  711. char *ReadToken(istream, delims, delimp)
  712. FILE *istream;
  713. char *delims;
  714. char *delimp;
  715. {
  716.   static char buf[BUFSIZ], *b=NULL, *r, *e;
  717.  
  718.   if (!b) b=buf;
  719.   while (1) {
  720.     while (*b && strchr("     ",*b)) b++;
  721.     if (!*b || *b=='#') {
  722.       b = buf; 
  723.       if (!istream || !fgets(buf,BUFSIZ,istream)) return(NULL);
  724.       if (buf[strlen(buf)-1]=='\n') buf[strlen(buf)-1]='\0';
  725.       continue;
  726.     }
  727.     r=b;
  728.     for(b=r; *b && !strchr(delims,*b); ++b) if (*b == '\\') ++b;
  729.     *delimp = *b;
  730.     if (*b) *b++ = '\0';
  731.     for(e = r+strlen(r)-1; e>=r && strchr("     ",*e); *e-- = '\0');
  732.     return(r);
  733.   }
  734. }
  735.  
  736. int ReadExtraTermCapabilities(stream,termtype)
  737. FILE *stream;
  738. char *termtype;
  739. {
  740.   FILE *fp;
  741.   char message[BUFSIZ], fn[BUFSIZ], *ns;
  742.   int pass = 0, found = 0;
  743.   char *b, *delim = " ";
  744.  
  745.   sprintf(fn,"%s/ExpectCap.%s",ExpectDir,termtype);
  746.   fp = fopen(fn,"r");
  747.   if (!fp) { sprintf(fn,"%s/ExpectCap",ExpectDir); fp = fopen(fn,"r"); }
  748.   if (!fp) return(0);
  749.   
  750.   while(b = ReadToken(fp, "|,", delim)) {
  751.     if (!strcmp(b,termtype)) {
  752.       found = 1;
  753.       if (*delim != ',') ReadToken(fp,",",delim);
  754.       break;
  755.     }
  756.     if (*delim == ',') while(ReadToken(fp,",",delim) && (*delim==','));
  757.   }
  758.   while(b && (*delim==',') && (b = ReadToken(fp, ",=#@", delim))) {
  759.     char terminfo[64];
  760.     Entry *entry;
  761.  
  762.     strcpy(terminfo, b);
  763.     entry = TerminfoToEntry(terminfo);
  764.     if (!entry) { sprintf(message,"Bad Terminfo: %s in Term File: %s", terminfo,fn); fatal(message); exit(-1); }
  765.     if (!pass++ && stream) fprintf(stream,",\n# Adding Sequences from %s", fn);
  766.     if (*entry->type == *TBOOL) {
  767.       if (*delim == '@') {
  768.     ns = (char *)0;
  769.     ReadToken(NULL,",",delim);
  770.       }
  771.       else ns = (char *)1;
  772.       InstallCapability(stream, terminfo, entry->termcap, entry->type, ns, entry->func, entry->name, entry->doc);
  773.     }
  774.     else if (*entry->type == *TNUM) {
  775.       if (*delim != '#' || !(b = ReadToken(fp, ",", delim))) {
  776.     sprintf(message,"Bad Terminfo: %s in Term File: %s", terminfo,fn); fatal(message); exit(-1);
  777.       }
  778.       ns = (char *)atoi(b);
  779.       InstallCapability(stream, terminfo, entry->termcap, entry->type, ns, entry->func, entry->name, entry->doc);
  780.     }
  781.     else {
  782.       char nseq[BUFSIZ];
  783.       if (*delim != '=' || !(b = ReadToken(fp, ",", delim))) {
  784.     sprintf(message,"Bad Terminfo: %s in Term File: %s", terminfo,fn); fatal(message); exit(-1);
  785.       }
  786.       for(ns=nseq; *b; ++b, ++ns) {
  787.       switch (*b) {
  788.       case '\\':
  789.         switch (*(++b)) {
  790.         case 'n': *ns = '\n'; break;
  791.         case 'l': *ns = ' '; break;
  792.         case 'r': *ns = '\r'; break;
  793.         case 't': *ns = '\t'; break;
  794.         case 'b': *ns = '\b'; break;
  795.         case 'f': *ns = '\f'; break;
  796.         case 's': *ns = ' '; break;
  797.         case '0': *ns = '\200'; break;
  798.         case 'E': case 'e': *ns = ''; break;
  799.         default: *ns = *b; break;
  800.         } break;
  801.       case '^': *ns = (*(++b) - 'A' + ''); break;
  802.       default: *ns = *b; break;
  803.       }
  804.     }
  805.       *ns = '\0';
  806.       ns = nseq;
  807.       InstallCapability(stream, terminfo, entry->termcap, entry->type, ns, entry->func, entry->name, entry->doc);
  808.     }
  809.   }
  810.   fclose(fp);
  811.   return(found);
  812. }
  813.  
  814. static jmp_buf input_env;    /* for interruptable read() */
  815. static int input_env_valid = FALSE;    /* whether we can longjmp or not */
  816.  
  817. CacheInput() {
  818.   if (input_env_valid && Session->breaksp) {
  819.     longjmp(input_env,2);
  820.   }
  821.   return(0);
  822. }
  823.  
  824. #define IBUFSIZ 128
  825. char *OutputSequence = NULL;
  826. long handle_output()
  827. { /* handle_output - Main loop of output process. Reads and dispatches characters from output stream. */
  828.   static char CurrInputSeq[IBUFSIZ]; /* don't want this on stack */
  829.   static long n, pop=0, i, len;
  830.   static FPTR func;
  831.   static int readcount;
  832.  
  833.   Session->input_cached_p = 0;
  834.   input_env_valid = FALSE;
  835.   if (setjmp(input_env) != 2) {
  836.     for (n=0; Nextch(0.0, CurrInputSeq); n++) {
  837.       (OutputSequence=EndPtr = CurrInputSeq)[1] = '\0';
  838.       while (*EndPtr) {
  839.     OutputSequence = EndPtr;
  840.     for (i=0; i < Argno; ++i) Arg[i]=0; Argno=0; pop = 0;
  841.     NextchInputWait = (*EndPtr == '\033') ? 3.0 : 1.0;
  842.     func=SmartHash(Session->term->termtab, EndPtr, &pop);
  843. #ifdef DEBUG_TERMFUNCS
  844.     if (Session->raw_log && func) {
  845.       fprintf(Session->raw_log, "\n<<%s: %d %d,%d,%d>>\n", FuncToEntry(func)->name, Argno, Arg[0], Arg[1], Arg[2]);
  846.       fflush(Session->raw_log);
  847.     }
  848. #endif
  849.     if (func) (*func)();
  850.     else if (*EndPtr == NUL && Session->term->bool_in==1) { /* NUL inserts whitespace */
  851.       EndPtr++; BPUTC(' ');
  852.     }
  853.     else if ((*EndPtr >= ' ') && !(*EndPtr & ~BITS7)) BPUTC(Session, *EndPtr++);
  854.     else EndPtr++;
  855.     input_env_valid = TRUE;
  856.       }
  857.     }
  858.   }
  859.   else {            /* Jumped */
  860.     len=strlen(OutputSequence);
  861.     for (i=0; i<len; ++i) UngetChar(OutputSequence[len-i-1]);
  862.     Session->input_cached_p = len;
  863.   }
  864.   input_env_valid = FALSE;
  865.   return(n);
  866. }
  867.  
  868. #include <term.h>
  869.  
  870. TermTab *EmulateTerm(termtype, inp, outp)
  871. FILE *inp, *outp;
  872. char *termtype;
  873. {
  874.   static int n, ok, found;
  875.   static int pass = 0;
  876.   extern char *Strdup();
  877. #define MAXTERMTYPE 32
  878.   static TermTab terms[MAXTERMTYPE];
  879.   static TERMINAL emu_term;
  880.   static TERMINAL *oterm;
  881.   oterm = cur_term;
  882.   ok = 1; 
  883.   if (!pass++) {
  884.     memset((char *)terms, -1, sizeof(terms));
  885.     for (n=0; n < MAXTERMTYPE; ++n) {
  886.       terms[n].type = NULL; 
  887.       terms[n].termtab = NULL; 
  888.       terms[n].Local=0;
  889.       terms[n].InsertMode=1;
  890.     }
  891.     unlink(WLOG);
  892.     ExpectDir=(char *)getenv("EXPECT_DIR");
  893.     ExpectLogDir=(char *)getenv("EXPECT_LOGDIR");
  894.     if (!ExpectDir) ExpectDir = (char *)Strdup(PROGDIR);
  895.     if (!ExpectLogDir) ExpectLogDir = (char *)getenv("HOME");
  896.     if (!ExpectLogDir) ExpectLogDir = (char *) Strdup("");
  897.     { TermTab tt;
  898.       CurrTerm = &tt;
  899.       MapTermCaps(stdout, NewEntry);
  900.       CurrTerm = NULL;
  901.     }
  902.   }
  903.   for (n=0; n < MAXTERMTYPE && terms[n].type; ++n)
  904.     if (!strcmp(terms[n].type, termtype)) break;
  905.   CurrTerm = terms + n;
  906.   if (n < MAXTERMTYPE && !CurrTerm->type) {
  907.     FILE *stream;
  908.     if (SetAlarm(5.0)) {
  909.       set_curterm(&emu_term); 
  910.       setupterm(Strdup(termtype), fileno(outp), &ok);
  911.     }
  912.     ClearAlarm();
  913.     if (ok != 1) {
  914.       /* del_curterm(&emu_term); */ 
  915.       set_curterm(oterm);
  916.       /* return(NULL); */
  917.     }
  918.     { char buf[64];
  919.       sprintf(buf,"%s/ExpectCap.terminfo", ExpectLogDir);
  920.       stream = fopen(buf,"w");
  921.       if (!stream) {
  922.         sprintf(buf,"ExpectCap.terminfo", ExpectLogDir);
  923.         stream = fopen(buf,"w");
  924.       }
  925.       if (!stream) {
  926.         sprintf(buf,"/tmp/ExpectCap.terminfo", ExpectLogDir);
  927.         stream = fopen(buf,"w");
  928.       }
  929.     }
  930.     if (stream) fprintf(stream,"%s", termtype); 
  931.     EscSeqTab = NewNode();
  932.     CurrTerm->type = Strdup(termtype);
  933.     CurrTerm->termtab = EscSeqTab;
  934. #if CLOBBER_OLD_VAL
  935.     if (ok && stream) fprintf(stream,",\n# Adding Sequences from Terminfo");
  936.     if (ok) MapTermCaps(stream, InstallCapability);
  937.     found=ReadExtraTermCapabilities(stream, Strdup(termtype));
  938. #else
  939.     found=ReadExtraTermCapabilities(stream, Strdup(termtype));
  940.     if (ok && stream) fprintf(stream,",\n# Adding Sequences from Terminfo");
  941.     if (ok) MapTermCaps(stream, InstallCapability);
  942. #endif
  943.     if (!ok && !found) { if (stream != stdout && stream) fclose(stream); return(NULL); }
  944.     if (stream) fprintf(stream,",\n# Nodes: %d", NodeCurr);
  945.     if (stream) fprintf(stream,",\n# Entries:   %d", EntryCurr);
  946.     if (stream) fflush(stream);
  947.  
  948.     ShowTermCapabilities(stream,TBOOL);
  949.     ShowTermCapabilities(stream,TNUM);
  950.     ShowTermCapabilities(stream,TINFO);
  951. /*    DumpHashTab(stream,EscSeqTab); */
  952.     set_curterm(oterm);
  953.     if (stream) { 
  954.       time_t ltime;
  955.       time(<ime);    
  956.       fprintf(stream,"\n# %s", ctime(<ime));
  957.     }
  958.     if (stream && stream != stdout) fclose(stream);
  959.   } else EscSeqTab = CurrTerm->termtab;
  960.   return(CurrTerm);
  961. }
  962.  
  963. #define OFFSET(STRUCT, FIELD) ((int)(&STRUCT->FIELD)-(int)(STRUCT))
  964. MapTermCaps(stream, func)
  965. void (*func)();
  966. FILE *stream;
  967. {
  968.   /* Boolean Capabilities */
  969. #ifndef auto_right_margin
  970. #define auto_right_margin -1
  971. #endif
  972.   (*func)(stream,"am",     "am",    TBOOL,   auto_right_margin,    OFFSET(CurrTerm,bool_am),    NULL,    "wraps right");
  973. #ifndef auto_left_margin
  974. #define auto_left_margin -1
  975. #endif
  976.   (*func)(stream,"bw",    "bw",    TBOOL,   auto_left_margin,    OFFSET(CurrTerm,bool_bw),    NULL,    "left wrap");
  977. #ifndef hard_cursor
  978. #define hard_cursor -1
  979. #endif
  980.   (*func)(stream,"chts","HC",    TBOOL,   hard_cursor,        OFFSET(CurrTerm,bool_chts),    NULL,    "hard to see curs needs to be more visible");
  981. #ifndef command_character
  982. #define command_character -1
  983. #endif
  984.   (*func)(stream,"cmdch","CC",    TBOOL,   command_character,    OFFSET(CurrTerm,bool_cmdch),    NULL,    "Indicates term command prot char can be set");
  985. #ifndef memory_above
  986. #define memory_above -1
  987. #endif
  988.   (*func)(stream,"da",    "da",    TBOOL,   memory_above,        OFFSET(CurrTerm,bool_da),    NULL,    "Can retain display memory above screen");
  989. #ifndef memory_below
  990. #define memory_below -1
  991. #endif
  992.   (*func)(stream,"db",    "db",    TBOOL,   memory_below,        OFFSET(CurrTerm,bool_db),    NULL,    "Can retain display memory below screen");
  993. #ifndef erase_overstrike
  994. #define erase_overstrike -1
  995. #endif
  996.   (*func)(stream,"eo",    "eo",    TBOOL,   erase_overstrike,    OFFSET(CurrTerm,bool_eo),    NULL,    "Can erase overstrike with blanks");
  997. #ifndef status_line_esc_ok
  998. #define status_line_esc_ok -1
  999. #endif
  1000.   (*func)(stream,"eslok","es",    TBOOL,   status_line_esc_ok,    OFFSET(CurrTerm,bool_eslok),    NULL,    "Escape can be used on status line");
  1001. #ifndef generic_type
  1002. #define generic_type -1
  1003. #endif
  1004.   (*func)(stream,"gn",    "gn",    TBOOL,   generic_type,        OFFSET(CurrTerm,bool_gn),    NULL,    "Generic line type");
  1005. #ifndef hard_copy
  1006. #define hard_copy -1
  1007. #endif
  1008.   (*func)(stream,"hc",    "hc",    TBOOL,   hard_copy,        OFFSET(CurrTerm,bool_hc),    NULL,    "term is hardcopy printer");
  1009. #ifndef has_status_line
  1010. #define has_status_line -1
  1011. #endif
  1012.   (*func)(stream,"hs",    "hs",    TBOOL,   has_status_line,    OFFSET(CurrTerm,bool_hs),    NULL,    "Has extra status line");
  1013. #ifndef tilde_glitch
  1014. #define tilde_glitch -1
  1015. #endif
  1016.   (*func)(stream,"hz",    "hz",    TBOOL,   tilde_glitch,        OFFSET(CurrTerm,bool_hz),    NULL,    "Can't print ~");
  1017. #ifndef insert_null_glitch
  1018. #define insert_null_glitch -1
  1019. #endif
  1020.   (*func)(stream,"in",    "in",    TBOOL,   insert_null_glitch,    OFFSET(CurrTerm,bool_in),    NULL,    "NULL(o200) inserts whitespace");
  1021. #ifndef has_meta_key
  1022. #define has_meta_key -1
  1023. #endif
  1024.   (*func)(stream,"km",    "km",    TBOOL,   has_meta_key,        OFFSET(CurrTerm,bool_km),    NULL,    "has meta key");
  1025. #ifndef prtr_silent
  1026. #define prtr_silent -1
  1027. #endif
  1028.   (*func)(stream,"mc5i","5i",    TBOOL,   prtr_silent,        OFFSET(CurrTerm,bool_mc5i),    NULL,    "Terminal aux prtr causes no echo on screen");
  1029. #ifndef move_insert_mode
  1030. #define move_insert_mode -1
  1031. #endif
  1032.   (*func)(stream,"mir",    "mi",    TBOOL,   move_insert_mode,    OFFSET(CurrTerm,bool_mir),    NULL,    "cursor may move in insert mode");
  1033. #ifndef cursor_mem_address
  1034. #define cursor_mem_address -1
  1035. #endif
  1036.   (*func)(stream,"mrcup","CM",    TBOOL,    cursor_mem_address,    OFFSET(CurrTerm,bool_mrcup),    NULL,    "cursor relative memory addressing");
  1037. #ifndef move_standout_mode
  1038. #define move_standout_mode -1
  1039. #endif
  1040.   (*func)(stream,"msgr","ms",    TBOOL,   move_standout_mode,    OFFSET(CurrTerm,bool_msgr),    NULL,    "Is safe to move in standout modes");
  1041. #ifndef needs_xon_xoff
  1042. #define needs_xon_xoff -1
  1043. #endif
  1044.   (*func)(stream,"nxon","nx",    TBOOL, needs_xon_xoff,        OFFSET(CurrTerm,bool_nxon),    NULL,    "Padding will not work, xon/xoff req");
  1045. #ifndef no_pad_char
  1046. #define no_pad_char -1
  1047. #endif
  1048.   (*func)(stream,"npc",    "NP",    TBOOL,   no_pad_char,        OFFSET(CurrTerm,bool_npc),    NULL,    "No pad char exists for the terminal");
  1049. #ifndef non_rev_rmcup
  1050. #define non_rev_rmcup -1
  1051. #endif
  1052.   (*func)(stream,"nrrmc","NR",    TBOOL,   non_rev_rmcup,        OFFSET(CurrTerm,bool_nrrmc),    NULL,    "smcup cannot reverse rmcup");
  1053. #ifndef over_strike
  1054. #define over_strike -1
  1055. #endif
  1056.   (*func)(stream,"os",    "os",    TBOOL,   over_strike,        OFFSET(CurrTerm,bool_os),    NULL,    "overstrike");
  1057. #ifndef transparent_underline
  1058. #define transparent_underline -1
  1059. #endif
  1060.   (*func)(stream,"ul",    "ul",    TBOOL,   transparent_underline,    OFFSET(CurrTerm,bool_ul),    NULL,    "underline");
  1061. #ifndef eat_newline_glitch
  1062. #define eat_newline_glitch -1
  1063. #endif
  1064.   (*func)(stream,"xenl","xn",    TBOOL,   eat_newline_glitch,    OFFSET(CurrTerm,bool_xenl),    NULL,    "New-line ignored after 80 cols");
  1065. #ifndef ceol_standout_glitch
  1066. #define ceol_standout_glitch -1
  1067. #endif
  1068.   (*func)(stream,"shp",    "sh",    TBOOL,   ceol_standout_glitch,    OFFSET(CurrTerm,bool_xhp),    NULL,    "standout not erased by overwriting(xhp?)");
  1069. #ifndef ceol_standout_glitch
  1070. #define ceol_standout_glitch -1
  1071. #endif
  1072.   (*func)(stream,"xhp",    "xs",    TBOOL,   ceol_standout_glitch,    OFFSET(CurrTerm,bool_xhp),    NULL,    "standout not erased by overwriting");
  1073. #ifndef xon_xoff
  1074. #define xon_xoff -1
  1075. #endif
  1076.   (*func)(stream,"xon",    "xo",    TBOOL,   xon_xoff,        OFFSET(CurrTerm,bool_xon),    NULL,    "uses xon/xoff");
  1077. #ifdef beehive_glitch
  1078.   (*func)(stream,"xsb",    "xb",    TBOOL,   beehive_glitch,    OFFSET(CurrTerm,bool_xsb),    NULL,    "No escape or ctrl-C,(f1=esc, f2=ctrl-c)");
  1079. #else
  1080. #ifndef no_esc_ctlc
  1081. #define no_esc_ctlc -1
  1082. #endif
  1083.   (*func)(stream,"xsb",    "xs",    TBOOL,   no_esc_ctlc,        OFFSET(CurrTerm,bool_xsb),    NULL,    "No escape or ctrl-C,(f1=esc, f2=ctrl-c)");
  1084. #endif
  1085. /*(*func)(stream,"xsb",    "xb",    TBOOL,   no_esc_ctlc,        NULL,    NULL,    "No escape or ctrl-C,(f1=esc, f2=ctrl-c)");*/
  1086. #ifdef teleray_glitch
  1087.   (*func)(stream,"xt",    "xt",    TBOOL,   teleray_glitch,    OFFSET(CurrTerm,bool_xt),    NULL,    "backspace with spaces over tabs");
  1088. #else
  1089. #ifndef dest_tabs_magic_smso
  1090. #define dest_tabs_magic_smso -1
  1091. #endif
  1092.   (*func)(stream,"xt",    "xt",    TBOOL,   dest_tabs_magic_smso,    OFFSET(CurrTerm,bool_xt),    NULL,    "backspace with spaces over tabs"); 
  1093. #endif
  1094.  
  1095.   /* Numeric Capablities */
  1096. #ifndef columns
  1097. #define columns -1
  1098. #endif
  1099.   (*func)(stream,"cols",    "co",    TNUM,    columns,    OFFSET(CurrTerm,int_cols),    NULL,    "columns");
  1100. #ifndef init_tabs
  1101. #define init_tabs -1
  1102. #endif
  1103.   (*func)(stream,"it",    "it",    TNUM,    init_tabs,        OFFSET(CurrTerm,int_it),    NULL,    "initial hardware tabstops");
  1104. #ifndef label_height
  1105. #define label_height -1
  1106. #endif
  1107.   (*func)(stream,"lh",    "lh",    TNUM,    label_height,        OFFSET(CurrTerm,int_lh),    NULL,    "label height");
  1108. #ifndef lines
  1109. #define lines -1
  1110. #endif
  1111.   (*func)(stream,"lines",    "li",    TNUM,    lines,        OFFSET(CurrTerm,int_lines),    NULL,    "lines");
  1112. #ifndef lines_of_memory
  1113. #define lines_of_memory -1
  1114. #endif
  1115.   (*func)(stream,"lm",    "lm",    TNUM,    lines_of_memory,    OFFSET(CurrTerm,int_lm),    NULL,    "lines of memory if > lines(0=varies)");
  1116. #ifndef label_width
  1117. #define label_width -1
  1118. #endif
  1119.   (*func)(stream,"lw",    "lw",    TNUM,    label_width,        OFFSET(CurrTerm,int_lw),    NULL,    "number of columns in each label");
  1120. #ifndef num_labels
  1121. #define num_labels -1
  1122. #endif
  1123.   (*func)(stream,"nlab",    "Nl",    TNUM,    num_labels,    OFFSET(CurrTerm,int_nlab),    NULL,    "number of labels on screen(start at 1)");
  1124. #ifndef padding_baud_rate
  1125. #define padding_baud_rate -1
  1126. #endif
  1127.   (*func)(stream,"pb",    "pb",    TNUM,    padding_baud_rate,    OFFSET(CurrTerm,int_pb),    NULL,    "lowest baud rate where padding needed");
  1128. #ifndef width_status_line
  1129. #define width_status_line -1
  1130. #endif
  1131.   (*func)(stream,"wsl",    "ws",    TNUM,    width_status_line,    OFFSET(CurrTerm,int_wsl),    NULL,    "number of cols in status line");
  1132. #ifndef magic_cookie_glitch
  1133. #define magic_cookie_glitch -1
  1134. #endif
  1135.   (*func)(stream,"xmc",    "sg",    TNUM,    magic_cookie_glitch,    OFFSET(CurrTerm,int_xmc),    NULL,    "number of blank chars left by smso or rmso");
  1136. #ifndef virtual_terminal
  1137. #define virtual_terminal -1
  1138. #endif
  1139.   (*func)(stream,"vt",    "vt",    TNUM,    virtual_terminal,    OFFSET(CurrTerm,int_vt),    NULL,    "virtual terminal number");
  1140.  
  1141.   /* string info */
  1142.  
  1143. #ifndef appl_defined_str
  1144. #define appl_defined_str NULL
  1145. #endif
  1146.   (*func)(stream,"apstr",    "za",    TINFO, appl_defined_str,    OFFSET(CurrTerm,str_apstr),    "apstr",    "Application defined string");
  1147. #ifndef box_attr_1
  1148. #define box_attr_1 NULL
  1149. #endif
  1150.   (*func)(stream,"batt1",    "Bx",    TINFO, box_attr_1,        OFFSET(CurrTerm,str_batt1),    "batt1",    "atributes for box_chars_1");
  1151. #ifndef box_attr_2
  1152. #define box_attr_2 NULL
  1153. #endif
  1154.   (*func)(stream,"batt2",    "Byx",    TINFO, box_attr_2,        OFFSET(CurrTerm,str_batt2),    "batt2",    "atributes for box_chars_2");
  1155. #ifndef box_chars_1
  1156. #define box_chars_1 NULL
  1157. #endif
  1158.   (*func)(stream,"box1",    "bx",    TINFO, box_chars_1,        OFFSET(CurrTerm,str_box1),    "box1",        "Terminal box chars 1");
  1159. #ifndef box_chars_2
  1160. #define box_chars_2 NULL
  1161. #endif
  1162.   (*func)(stream,"box2",    "by",    TINFO, box_chars_2,        OFFSET(CurrTerm,str_box2),    "box2",        "Terminal box chars 2");
  1163. #ifndef color_bg_0
  1164. #define color_bg_0 NULL
  1165. #endif
  1166.   (*func)(stream,"colb0",    "d0",    TINFO, color_bg_0,        OFFSET(CurrTerm,str_colb0),    "colb0",    "Background color 0 black");
  1167. #ifndef color_bg_1
  1168. #define color_bg_1 NULL
  1169. #endif
  1170.   (*func)(stream,"colb1",    "d1",    TINFO, color_bg_1,        OFFSET(CurrTerm,str_colb1),    "colb1",    "Background color 1 red");
  1171. #ifndef color_bg_2
  1172. #define color_bg_2 NULL
  1173. #endif
  1174.   (*func)(stream,"colb2",    "d2",    TINFO, color_bg_2,        OFFSET(CurrTerm,str_colb2),    "colb2",    "Background color 2 green");
  1175. #ifndef color_bg_3
  1176. #define color_bg_3 NULL
  1177. #endif
  1178.   (*func)(stream,"colb3",    "d3",    TINFO, color_bg_3,        OFFSET(CurrTerm,str_colb3),    "colb3",    "Background color 3 brown");
  1179. #ifndef color_bg_4
  1180. #define color_bg_4 NULL
  1181. #endif
  1182.   (*func)(stream,"colb4",    "d4",    TINFO, color_bg_4,        OFFSET(CurrTerm,str_colb4),    "colb4",    "Background color 4 blue");
  1183. #ifndef color_bg_5
  1184. #define color_bg_5 NULL
  1185. #endif
  1186.   (*func)(stream,"colb5",    "d5",    TINFO, color_bg_5,        OFFSET(CurrTerm,str_colb5),    "colb5",    "Background color 5 magenta");
  1187. #ifndef color_bg_6
  1188. #define color_bg_6 NULL
  1189. #endif
  1190.   (*func)(stream,"colb6",    "d6",    TINFO, color_bg_6,        OFFSET(CurrTerm,str_colb6),    "colb6",    "Background color 6 cyan");
  1191. #ifndef color_bg_7
  1192. #define color_bg_7 NULL
  1193. #endif
  1194.   (*func)(stream,"colb7",    "d7",    TINFO, color_bg_7,        OFFSET(CurrTerm,str_colb7),    "colb7",    "Background color 7 white");
  1195. #ifndef color_fg_0
  1196. #define color_fg_0 NULL
  1197. #endif
  1198.   (*func)(stream,"colf0",    "0",    TINFO, color_fg_0,        OFFSET(CurrTerm,str_colf0),    "colf0",    "Foreground color 0 white");
  1199. #ifndef color_fg_1
  1200. #define color_fg_1 NULL
  1201. #endif
  1202.   (*func)(stream,"colf1",    "c1",    TINFO, color_fg_1,        OFFSET(CurrTerm,str_colf1),    "colf1",    "Foreground color 1 red");
  1203. #ifndef color_fg_2
  1204. #define color_fg_2 NULL
  1205. #endif
  1206.   (*func)(stream,"colf2",    "c2",    TINFO, color_fg_2,        OFFSET(CurrTerm,str_colf2),    "colf2",    "Foreground color 2 green");
  1207. #ifndef color_fg_3
  1208. #define color_fg_3 NULL
  1209. #endif
  1210.   (*func)(stream,"colf3",    "c3",    TINFO, color_fg_3,        OFFSET(CurrTerm,str_colf3),    "colf3",    "Foreground color 3 brown");
  1211. #ifndef color_fg_4
  1212. #define color_fg_4 NULL
  1213. #endif
  1214.   (*func)(stream,"colf4",    "c4",    TINFO, color_fg_4,        OFFSET(CurrTerm,str_colf4),    "colf4",    "Foreground color 4 blue");
  1215. #ifndef color_fg_5
  1216. #define color_fg_5 NULL
  1217. #endif
  1218.   (*func)(stream,"colf5",    "c5",    TINFO, color_fg_5,        OFFSET(CurrTerm,str_colf5),    "colf5",    "Foreground color 5 magenta");
  1219. #ifndef color_fg_6
  1220. #define color_fg_6 NULL
  1221. #endif
  1222.   (*func)(stream,"colf6",    "c6",    TINFO, color_fg_6,        OFFSET(CurrTerm,str_colf6),    "colf6",    "Foreground color 6 cyan");
  1223. #ifndef color_fg_7
  1224. #define color_fg_7 NULL
  1225. #endif
  1226.   (*func)(stream,"colf7",    "c7",    TINFO, color_fg_7,        OFFSET(CurrTerm,str_colf7),    "colf7",    "Foreground color 7 black");
  1227. #ifndef init_file
  1228. #define init_file NULL
  1229. #endif
  1230.   (*func)(stream,"if",        "if",    TINFO, init_file,        OFFSET(CurrTerm,str_if),    "if",        "/usr/lib/tabset/? init file");
  1231. #ifndef insert_padding
  1232. #define insert_padding NULL
  1233. #endif
  1234.   (*func)(stream,"ip",        "ip",    TINFO, insert_padding,        OFFSET(CurrTerm,str_ip),    "ip",        "insert padding after char inserted");
  1235. #ifndef init_prog
  1236. #define init_prog NULL
  1237. #endif
  1238.   (*func)(stream,"iprog",    "iP",    TINFO, init_prog,        OFFSET(CurrTerm,str_iprog),    "iprog",    "path name for prog initialization");
  1239. #ifndef key_backspace
  1240. #define key_backspace NULL
  1241. #endif
  1242.   (*func)(stream,"kbs",        "kb",    TINFO, key_backspace,        OFFSET(CurrTerm,str_kbs),    "kbs",        "backspace key");
  1243. #ifndef key_sbeg
  1244. #define key_sbeg NULL
  1245. #endif
  1246.   (*func)(stream,"kBEG",    "&9",    TINFO, key_sbeg,        OFFSET(CurrTerm,str_kBEG),    "kBEG",        "Shifted beginning key");
  1247. #ifndef key_scancel
  1248. #define key_scancel NULL
  1249. #endif
  1250.   (*func)(stream,"kCAN",    "&0",    TINFO, key_scancel,        OFFSET(CurrTerm,str_kCAN),    "kCAN",        "Shifted cancel key");
  1251. #ifndef key_scommand
  1252. #define key_scommand NULL
  1253. #endif
  1254.   (*func)(stream,"kCMD",    "*1",    TINFO, key_scommand,        OFFSET(CurrTerm,str_kCMD),    "kCMD",        "Shifted CMD key");
  1255. #ifndef key_scopy
  1256. #define key_scopy NULL
  1257. #endif
  1258.   (*func)(stream,"kCPY",    "*2",    TINFO, key_scopy,        OFFSET(CurrTerm,str_kCPY),    "kCPY",        "Shifted CPY key");
  1259. #ifndef key_screate
  1260. #define key_screate NULL
  1261. #endif
  1262.   (*func)(stream,"kCRT",    "*3",    TINFO, key_screate,        OFFSET(CurrTerm,str_kCRT),    "kCRT",        "Shifted CRT key");
  1263. #ifndef key_sdc
  1264. #define key_sdc NULL
  1265. #endif
  1266.   (*func)(stream,"kDC",        "*4",    TINFO, key_sdc,            OFFSET(CurrTerm,str_kDC),    "kDC",        "Shifted DC key");
  1267. #ifndef key_sdl
  1268. #define key_sdl NULL
  1269. #endif
  1270.   (*func)(stream,"kDL",        "*5",    TINFO, key_sdl,            OFFSET(CurrTerm,str_kDL),    "kDL",        "Shifted DL key");
  1271. #ifndef key_send
  1272. #define key_send NULL
  1273. #endif
  1274.   (*func)(stream,"kEND",    "*7",    TINFO, key_send,        OFFSET(CurrTerm,str_kEND),    "kEND",        "Shifted END key");
  1275. #ifndef key_seol
  1276. #define key_seol NULL
  1277. #endif
  1278.   (*func)(stream,"kEOL",    "*8",    TINFO, key_seol,        OFFSET(CurrTerm,str_kEOL),    "kEOL",        "Shifted EOL key");
  1279. #ifndef key_sexit
  1280. #define key_sexit NULL
  1281. #endif
  1282.   (*func)(stream,"kEXT",    "*9",    TINFO, key_sexit,        OFFSET(CurrTerm,str_kEXT),    "kEXT",        "Shifted EXT key");
  1283. #ifndef key_sfind
  1284. #define key_sfind NULL
  1285. #endif
  1286.   (*func)(stream,"kFND",    "*0",    TINFO, key_sfind,        OFFSET(CurrTerm,str_kFND),    "kFND",        "Shifted FND key");
  1287. #ifndef key_shelp
  1288. #define key_shelp NULL
  1289. #endif
  1290.   (*func)(stream,"kHLP",    "#1",    TINFO, key_shelp,        OFFSET(CurrTerm,str_kHLP),    "kHLP",        "Shifted HLP key");
  1291. #ifndef key_shome
  1292. #define key_shome NULL
  1293. #endif
  1294.   (*func)(stream,"kHOM",    "#2",    TINFO, key_shome,        OFFSET(CurrTerm,str_kHOM),    "kHOM",        "Shifted HOM key");
  1295. #ifndef key_sic
  1296. #define key_sic NULL
  1297. #endif
  1298.   (*func)(stream,"kIC",        "#3",    TINFO, key_sic,            OFFSET(CurrTerm,str_kIC),    "kIC",        "Shifted IC key");
  1299. #ifndef key_sleft
  1300. #define key_sleft NULL
  1301. #endif
  1302.   (*func)(stream,"kLFT",    "#4",    TINFO, key_sleft,        OFFSET(CurrTerm,str_kLFT),    "kLFT",        "Shifted LFT key");
  1303. #ifndef key_smove
  1304. #define key_smove NULL
  1305. #endif
  1306.   (*func)(stream,"kMOV",    "%b",    TINFO, key_smove,        OFFSET(CurrTerm,str_kMOV),    "kMOV",        "Shifted MOV key");
  1307. #ifndef key_smessage
  1308. #define key_smessage NULL
  1309. #endif
  1310.   (*func)(stream,"kMSG",    "%a",    TINFO, key_smessage,        OFFSET(CurrTerm,str_kMSG),    "kMSG",        "Shifted MSG key");
  1311. #ifndef key_snext
  1312. #define key_snext NULL
  1313. #endif
  1314.   (*func)(stream,"kNXT",    "%c",    TINFO, key_snext,        OFFSET(CurrTerm,str_kNXT),    "kNXT",        "Shifted NXT key");
  1315. #ifndef key_soptions
  1316. #define key_soptions NULL
  1317. #endif
  1318.   (*func)(stream,"kOPT",    "%d",    TINFO, key_soptions,        OFFSET(CurrTerm,str_kOPT),    "kOPT",        "Shifted OPT key");
  1319. #ifndef key_sprint
  1320. #define key_sprint NULL
  1321. #endif
  1322.   (*func)(stream,"kPRT",    "%f",    TINFO, key_sprint,        OFFSET(CurrTerm,str_kPRT),    "kPRT",        "Shifted PRT key");
  1323. #ifndef key_sprevious
  1324. #define key_sprevious NULL
  1325. #endif
  1326.   (*func)(stream,"kPRV",    "%e",    TINFO, key_sprevious,        OFFSET(CurrTerm,str_kPRV),    "kPRV",        "Shifted PRV key");
  1327. #ifndef key_sredo
  1328. #define key_sredo NULL
  1329. #endif
  1330.   (*func)(stream,"kRDO",    "%g",    TINFO, key_sredo,        OFFSET(CurrTerm,str_kRDO),    "kRDO",        "Shifted RDO key");
  1331. #ifndef key_srsume
  1332. #define key_srsume NULL
  1333. #endif
  1334.   (*func)(stream,"kRES",    "%j",    TINFO, key_srsume,        OFFSET(CurrTerm,str_kRES),    "kRES",        "Shifted RES key");
  1335. #ifndef key_sright
  1336. #define key_sright NULL
  1337. #endif
  1338.   (*func)(stream,"kRIT",    "%i",    TINFO, key_sright,        OFFSET(CurrTerm,str_kRIT),    "kRIT",        "Shifted RIT key");
  1339. #ifndef key_sreplace
  1340. #define key_sreplace NULL
  1341. #endif
  1342.   (*func)(stream,"kRPL",    "%h",    TINFO, key_sreplace,        OFFSET(CurrTerm,str_kRPL),    "kRPL",        "Shifted RPL key");
  1343. #ifndef key_ssave
  1344. #define key_ssave NULL
  1345. #endif
  1346.   (*func)(stream,"kSAV",    "!1",    TINFO, key_ssave,        OFFSET(CurrTerm,str_kSAV),    "kSAV",        "Shifted SAV key");
  1347. #ifndef key_ssuspend
  1348. #define key_ssuspend NULL
  1349. #endif
  1350.   (*func)(stream,"kSPD",    "!2",    TINFO, key_ssuspend,        OFFSET(CurrTerm,str_kSPD),    "kSPD",        "Shifted SPD key");
  1351. #ifndef key_sundo
  1352. #define key_sundo NULL
  1353. #endif
  1354.   (*func)(stream,"kUND",    "!3",    TINFO, key_sundo,        OFFSET(CurrTerm,str_kUND),    "kUND",        "Shifted UND key");
  1355. #ifndef key_a1
  1356. #define key_a1 NULL
  1357. #endif
  1358.   (*func)(stream,"ka1",        "K1",    TINFO, key_a1,            OFFSET(CurrTerm,str_ka1),    "ka1",        "a1 key, Upper left keypad");
  1359. #ifndef key_a3
  1360. #define key_a3 NULL
  1361. #endif
  1362.   (*func)(stream,"ka3",        "K3",    TINFO, key_a3,            OFFSET(CurrTerm,str_ka3),    "ka3",        "a3 key, Upper right Key Pad");
  1363. #ifndef key_b2
  1364. #define key_b2 NULL
  1365. #endif
  1366.   (*func)(stream,"kb2",        "K2",    TINFO, key_b2,            OFFSET(CurrTerm,str_kb2),    "kb2",        "b2 key, Center key Pad");
  1367. #ifndef key_beg
  1368. #define key_beg NULL
  1369. #endif
  1370.   (*func)(stream,"kbeg",    "@1",    TINFO, key_beg,            OFFSET(CurrTerm,str_kbeg),    "kbeg",        "beg key");
  1371. #ifndef key_c1
  1372. #define key_c1 NULL
  1373. #endif
  1374.   (*func)(stream,"kc1",        "K4",    TINFO, key_c1,            OFFSET(CurrTerm,str_kc1),    "kc1",        "c1 key, Lower left keypad");
  1375. #ifndef key_c3
  1376. #define key_c3 NULL
  1377. #endif
  1378.   (*func)(stream,"kc3",        "K5",    TINFO, key_c3,            OFFSET(CurrTerm,str_kc3),    "kc3",        "c3 key, lower right keypad");
  1379. #ifndef key_cancel
  1380. #define key_cancel NULL
  1381. #endif
  1382.   (*func)(stream,"kcan",    "@2",    TINFO, key_cancel,        OFFSET(CurrTerm,str_kcan),    "kcan",        "cancel key");
  1383. #ifndef key_back_tab
  1384. #define key_back_tab NULL
  1385. #endif
  1386.   (*func)(stream,"kbtab",    "k0",    TINFO, key_back_tab,        OFFSET(CurrTerm,str_kbtab),    "kbtab",    "back tab key");
  1387. #ifndef key_cbtab
  1388. #define key_cbtab NULL
  1389. #endif
  1390.   (*func)(stream,"kcbt",    "kB",    TINFO, key_cbtab,        OFFSET(CurrTerm,str_kcbt),    "kcbt",        "back tab key");
  1391. #ifndef key_close
  1392. #define key_close NULL
  1393. #endif
  1394.   (*func)(stream,"kclo",    "@3",    TINFO, key_close,        OFFSET(CurrTerm,str_kclo),    "kclo",        "close key");
  1395. #ifndef key_command
  1396. #define key_command NULL
  1397. #endif
  1398.   (*func)(stream,"kcmd",    "@4",    TINFO, key_command,        OFFSET(CurrTerm,str_kcmd),    "kcmd",        "cmd key");  /* code "kc" ???? */
  1399. #ifndef key_command_pane
  1400. #define key_command_pane NULL
  1401. #endif
  1402.   (*func)(stream,"kcpn",    "kW",    TINFO, key_command_pane,    OFFSET(CurrTerm,str_kcpn),    "kcpn",        "Command pane key");
  1403. #ifndef key_copy
  1404. #define key_copy NULL
  1405. #endif
  1406.   (*func)(stream,"kcpy",    "@5",    TINFO, key_copy,        OFFSET(CurrTerm,str_kcpy),    "kcpy",        "cpy key");
  1407. #ifndef key_create
  1408. #define key_create NULL
  1409. #endif
  1410.   (*func)(stream,"kcrt",    "@6",    TINFO, key_create,        OFFSET(CurrTerm,str_kcrt),    "kcrt",        "create key");
  1411. #ifndef key_ctab
  1412. #define key_ctab NULL
  1413. #endif
  1414.   (*func)(stream,"kctab",    "kt",    TINFO, key_ctab,        OFFSET(CurrTerm,str_kctab),    "kctab",    "ctab key");
  1415. #ifndef key_do
  1416. #define key_do NULL
  1417. #endif
  1418.   (*func)(stream,"kdo",        "ki",    TINFO, key_do,            OFFSET(CurrTerm,str_kdo),    "kdo",        "do key");
  1419. #ifndef key_end
  1420. #define key_end NULL
  1421. #endif
  1422.   (*func)(stream,"kend",    "@7",    TINFO, key_end,            OFFSET(CurrTerm,str_kend),    "kend",        "end key"); /* code "kw" ??? */
  1423. #ifndef key_enter
  1424. #define key_enter NULL
  1425. #endif
  1426.   (*func)(stream,"kent",    "@8",    TINFO, key_enter,        OFFSET(CurrTerm,str_kent),    "kent",        "ent key");
  1427. #ifndef key_exit
  1428. #define key_exit NULL
  1429. #endif
  1430.   (*func)(stream,"kext",    "@9",    TINFO, key_exit,        OFFSET(CurrTerm,str_kext),    "kext",        "ext key");
  1431. #ifndef key_f0
  1432. #define key_f0 NULL
  1433. #endif
  1434.   (*func)(stream,"kf0",        "k0",    TINFO, key_f0,            OFFSET(CurrTerm,str_kf0),    "kf0",        "f0 key");
  1435. #ifndef key_f1
  1436. #define key_f1 NULL
  1437. #endif
  1438.   (*func)(stream,"kf1",        "k1",    TINFO, key_f1,            OFFSET(CurrTerm,str_kf1),    "kf1",        "f1 key");
  1439. #ifndef key_f2
  1440. #define key_f2 NULL
  1441. #endif
  1442.   (*func)(stream,"kf2",        "k2",    TINFO, key_f2,            OFFSET(CurrTerm,str_kf2),    "kf2",        "f2 key");
  1443. #ifndef key_f3
  1444. #define key_f3 NULL
  1445. #endif
  1446.   (*func)(stream,"kf3",        "k3",    TINFO, key_f3,            OFFSET(CurrTerm,str_kf3),    "kf3",        "f3 key");
  1447. #ifndef key_f4
  1448. #define key_f4 NULL
  1449. #endif
  1450.   (*func)(stream,"kf4",        "k4",    TINFO, key_f4,            OFFSET(CurrTerm,str_kf4),    "kf4",        "f4 key");
  1451. #ifndef key_f5
  1452. #define key_f5 NULL
  1453. #endif
  1454.   (*func)(stream,"kf5",        "k5",    TINFO, key_f5,            OFFSET(CurrTerm,str_kf5),    "kf5",        "f5 key");
  1455. #ifndef key_f6
  1456. #define key_f6 NULL
  1457. #endif
  1458.   (*func)(stream,"kf6",        "k6",    TINFO, key_f6,            OFFSET(CurrTerm,str_kf6),    "kf6",        "f6 key");
  1459. #ifndef key_f7
  1460. #define key_f7 NULL
  1461. #endif
  1462.   (*func)(stream,"kf7",        "k7",    TINFO, key_f7,            OFFSET(CurrTerm,str_kf7),    "kf7",        "f7 key");
  1463. #ifndef key_f8
  1464. #define key_f8 NULL
  1465. #endif
  1466.   (*func)(stream,"kf8",        "k8",    TINFO, key_f8,            OFFSET(CurrTerm,str_kf8),    "kf8",        "f8 key");
  1467. #ifndef key_f9
  1468. #define key_f9 NULL
  1469. #endif
  1470.   (*func)(stream,"kf9",        "k9",    TINFO, key_f9,            OFFSET(CurrTerm,str_kf9),    "kf9",        "f9 key");
  1471. #ifndef key_f10
  1472. #define key_f10 NULL
  1473. #endif
  1474.   (*func)(stream,"kf10",    "k;",    TINFO, key_f10,            OFFSET(CurrTerm,str_kf10),    "kf10",        "f10 key");
  1475. #ifndef key_f11
  1476. #define key_f11 NULL
  1477. #endif
  1478.   (*func)(stream,"kf11",    "F1",    TINFO, key_f11,            OFFSET(CurrTerm,str_kf11),    "kf11",        "f11 key");
  1479. #ifndef key_f12
  1480. #define key_f12 NULL
  1481. #endif
  1482.   (*func)(stream,"kf12",    "F2",    TINFO, key_f12,            OFFSET(CurrTerm,str_kf12),    "kf12",        "f12 key");
  1483. #ifndef key_f13
  1484. #define key_f13 NULL
  1485. #endif
  1486.   (*func)(stream,"kf13",    "F3",    TINFO, key_f13,            OFFSET(CurrTerm,str_kf13),    "kf13",        "f13 key");
  1487. #ifndef key_f14
  1488. #define key_f14 NULL
  1489. #endif
  1490.   (*func)(stream,"kf14",    "F4",    TINFO, key_f14,            OFFSET(CurrTerm,str_kf14),    "kf14",        "f14 key");
  1491. #ifndef key_f15
  1492. #define key_f15 NULL
  1493. #endif
  1494.   (*func)(stream,"kf15",    "F5",    TINFO, key_f15,            OFFSET(CurrTerm,str_kf15),    "kf15",        "f15 key");
  1495. #ifndef key_f16
  1496. #define key_f16 NULL
  1497. #endif
  1498.   (*func)(stream,"kf16",    "F6",    TINFO, key_f16,            OFFSET(CurrTerm,str_kf16),    "kf16",        "f16 key");
  1499. #ifndef key_f17
  1500. #define key_f17 NULL
  1501. #endif
  1502.   (*func)(stream,"kf17",    "F7",    TINFO, key_f17,            OFFSET(CurrTerm,str_kf17),    "kf17",        "f17 key");
  1503. #ifndef key_f18
  1504. #define key_f18 NULL
  1505. #endif
  1506.   (*func)(stream,"kf18",    "F8",    TINFO, key_f18,            OFFSET(CurrTerm,str_kf18),    "kf18",        "f18 key");
  1507. #ifndef key_f19
  1508. #define key_f19 NULL
  1509. #endif
  1510.   (*func)(stream,"kf19",    "F9",    TINFO, key_f19,            OFFSET(CurrTerm,str_kf19),    "kf19",        "f19 key");
  1511. #ifndef key_f20
  1512. #define key_f20 NULL
  1513. #endif
  1514.   (*func)(stream,"kf20",    "FA",    TINFO, key_f20,            OFFSET(CurrTerm,str_kf20),    "kf20",        "f20 key");
  1515. #ifndef key_f21
  1516. #define key_f21 NULL
  1517. #endif
  1518.   (*func)(stream,"kf21",    "FB",    TINFO, key_f21,            OFFSET(CurrTerm,str_kf21),    "kf21",        "f21 key");
  1519. #ifndef key_f22
  1520. #define key_f22 NULL
  1521. #endif
  1522.   (*func)(stream,"kf22",    "FC",    TINFO, key_f22,            OFFSET(CurrTerm,str_kf22),    "kf22",        "f22 key");
  1523. #ifndef key_f23
  1524. #define key_f23 NULL
  1525. #endif
  1526.   (*func)(stream,"kf23",    "FD",    TINFO, key_f23,            OFFSET(CurrTerm,str_kf23),    "kf23",        "f23 key");
  1527. #ifndef key_f24
  1528. #define key_f24 NULL
  1529. #endif
  1530.   (*func)(stream,"kf24",    "FE",    TINFO, key_f24,             OFFSET(CurrTerm,str_kf24),    "kf24",        "f24 key");
  1531. #ifndef key_f25
  1532. #define key_f25 NULL
  1533. #endif
  1534.   (*func)(stream,"kf25",    "FF",    TINFO, key_f25,            OFFSET(CurrTerm,str_kf25),    "kf25",        "f25 key");
  1535. #ifndef key_f26
  1536. #define key_f26 NULL
  1537. #endif
  1538.   (*func)(stream,"kf26",    "FG",    TINFO, key_f26,            OFFSET(CurrTerm,str_kf26),    "kf26",        "f26 key");
  1539. #ifndef key_f27
  1540. #define key_f27 NULL
  1541. #endif
  1542.   (*func)(stream,"kf27",    "FH",    TINFO, key_f27,            OFFSET(CurrTerm,str_kf27),    "kf27",        "f27 key");
  1543. #ifndef key_f28
  1544. #define key_f28 NULL
  1545. #endif
  1546.   (*func)(stream,"kf28",    "FI",    TINFO, key_f28,            OFFSET(CurrTerm,str_kf28),    "kf28",        "f28 key");
  1547. #ifndef key_f29
  1548. #define key_f29 NULL
  1549. #endif
  1550.   (*func)(stream,"kf29",    "FJ",    TINFO, key_f29,            OFFSET(CurrTerm,str_kf29),    "kf29",        "f29 key");
  1551. #ifndef key_f30
  1552. #define key_f30 NULL
  1553. #endif
  1554.   (*func)(stream,"kf30",    "FK",    TINFO, key_f30,            OFFSET(CurrTerm,str_kf30),    "kf30",        "f30 key");
  1555. #ifndef key_f31
  1556. #define key_f31 NULL
  1557. #endif
  1558.   (*func)(stream,"kf31",    "FL",    TINFO, key_f31,            OFFSET(CurrTerm,str_kf31),    "kf31",        "f31 key");
  1559. #ifndef key_f32
  1560. #define key_f32 NULL
  1561. #endif
  1562.   (*func)(stream,"kf32",    "FM",    TINFO, key_f32,            OFFSET(CurrTerm,str_kf32),    "kf32",        "f32 key");
  1563. #ifndef key_f33
  1564. #define key_f33 NULL
  1565. #endif
  1566.   (*func)(stream,"kf33",    "FN",    TINFO, key_f33,            OFFSET(CurrTerm,str_kf33),    "kf33",        "f33 key");
  1567. #ifndef key_f34
  1568. #define key_f34 NULL
  1569. #endif
  1570.   (*func)(stream,"kf34",    "FO",    TINFO, key_f34,            OFFSET(CurrTerm,str_kf34),    "kf34",        "f34 key");
  1571. #ifndef key_f35
  1572. #define key_f35 NULL
  1573. #endif
  1574.   (*func)(stream,"kf35",    "FP",    TINFO, key_f35,            OFFSET(CurrTerm,str_kf35),    "kf35",        "f35 key");
  1575. #ifndef key_f36
  1576. #define key_f36 NULL
  1577. #endif
  1578.   (*func)(stream,"kf36",    "FQ",    TINFO, key_f36,            OFFSET(CurrTerm,str_kf36),    "kf36",        "f36 key");
  1579. #ifndef key_f37
  1580. #define key_f37 NULL
  1581. #endif
  1582.   (*func)(stream,"kf37",    "FR",    TINFO, key_f37,            OFFSET(CurrTerm,str_kf37),    "kf37",        "f37 key");
  1583. #ifndef key_f38
  1584. #define key_f38 NULL
  1585. #endif
  1586.   (*func)(stream,"kf38",    "FS",    TINFO, key_f38,            OFFSET(CurrTerm,str_kf38),    "kf38",        "f38 key");
  1587. #ifndef key_f39
  1588. #define key_f39 NULL
  1589. #endif
  1590.   (*func)(stream,"kf39",    "FT",    TINFO, key_f39,            OFFSET(CurrTerm,str_kf39),    "kf39",        "f39 key");
  1591. #ifndef key_f40
  1592. #define key_f40 NULL
  1593. #endif
  1594.   (*func)(stream,"kf40",    "FU",    TINFO, key_f40,            OFFSET(CurrTerm,str_kf40),    "kf40",        "f40 key");
  1595. #ifndef key_f41
  1596. #define key_f41 NULL
  1597. #endif
  1598.   (*func)(stream,"kf41",    "FV",    TINFO, key_f41,            OFFSET(CurrTerm,str_kf41),    "kf41",        "f41 key");
  1599. #ifndef key_f42
  1600. #define key_f42 NULL
  1601. #endif
  1602.   (*func)(stream,"kf42",    "FW",    TINFO, key_f42,            OFFSET(CurrTerm,str_kf42),    "kf42",        "f42 key");
  1603. #ifndef key_f43
  1604. #define key_f43 NULL
  1605. #endif
  1606.   (*func)(stream,"kf43",    "FX",    TINFO, key_f43,            OFFSET(CurrTerm,str_kf43),    "kf43",        "f43 key");
  1607. #ifndef key_f44
  1608. #define key_f44 NULL
  1609. #endif
  1610.   (*func)(stream,"kf44",    "FY",    TINFO, key_f44,            OFFSET(CurrTerm,str_kf44),    "kf44",        "f44 key");
  1611. #ifndef key_f45
  1612. #define key_f45 NULL
  1613. #endif
  1614.   (*func)(stream,"kf45",    "FZ",    TINFO, key_f45,            OFFSET(CurrTerm,str_kf45),    "kf45",        "f45 key");
  1615. #ifndef key_f46
  1616. #define key_f46 NULL
  1617. #endif
  1618.   (*func)(stream,"kf46",    "Fa",    TINFO, key_f46,            OFFSET(CurrTerm,str_kf46),    "kf46",        "f46 key");
  1619. #ifndef key_f47
  1620. #define key_f47 NULL
  1621. #endif
  1622.   (*func)(stream,"kf47",    "Fb",    TINFO, key_f47,            OFFSET(CurrTerm,str_kf47),    "kf47",        "f47 key");
  1623. #ifndef key_f48
  1624. #define key_f48 NULL
  1625. #endif
  1626.   (*func)(stream,"kf48",    "Fc",    TINFO, key_f48,            OFFSET(CurrTerm,str_kf48),    "kf48",        "f48 key");
  1627. #ifndef key_f49
  1628. #define key_f49 NULL
  1629. #endif
  1630.   (*func)(stream,"kf49",    "Fd",    TINFO, key_f49,            OFFSET(CurrTerm,str_kf49),    "kf49",        "f49 key");
  1631. #ifndef key_f50
  1632. #define key_f50 NULL
  1633. #endif
  1634.   (*func)(stream,"kf50",    "Fe",    TINFO, key_f50,            OFFSET(CurrTerm,str_kf50),    "kf50",        "f50 key");
  1635. #ifndef key_f51
  1636. #define key_f51 NULL
  1637. #endif
  1638.   (*func)(stream,"kf51",    "Ff",    TINFO, key_f51,            OFFSET(CurrTerm,str_kf51),    "kf51",        "f51 key");
  1639. #ifndef key_f52
  1640. #define key_f52 NULL
  1641. #endif
  1642.   (*func)(stream,"kf52",    "Fg",    TINFO, key_f52,            OFFSET(CurrTerm,str_kf52),    "kf52",        "f52 key");
  1643. #ifndef key_f53
  1644. #define key_f53 NULL
  1645. #endif
  1646.   (*func)(stream,"kf53",    "Fh",    TINFO, key_f53,            OFFSET(CurrTerm,str_kf53),    "kf53",        "f53 key");
  1647. #ifndef key_f54
  1648. #define key_f54 NULL
  1649. #endif
  1650.   (*func)(stream,"kf54",    "Fi",    TINFO, key_f54,            OFFSET(CurrTerm,str_kf54),    "kf54",        "f54 key");
  1651. #ifndef key_f55
  1652. #define key_f55 NULL
  1653. #endif
  1654.   (*func)(stream,"kf55",    "Fj",    TINFO, key_f55,            OFFSET(CurrTerm,str_kf55),    "kf55",        "f55 key");
  1655. #ifndef key_f56
  1656. #define key_f56 NULL
  1657. #endif
  1658.   (*func)(stream,"kf56",    "Fk",    TINFO, key_f56,            OFFSET(CurrTerm,str_kf56),    "kf56",        "f56 key");
  1659. #ifndef key_f57
  1660. #define key_f57 NULL
  1661. #endif
  1662.   (*func)(stream,"kf57",    "Fl",    TINFO, key_f57,            OFFSET(CurrTerm,str_kf57),    "kf57",        "f57 key");
  1663. #ifndef key_f58
  1664. #define key_f58 NULL
  1665. #endif
  1666.   (*func)(stream,"kf58",    "Fm",    TINFO, key_f58,            OFFSET(CurrTerm,str_kf58),    "kf58",        "f58 key");
  1667. #ifndef key_f59
  1668. #define key_f59 NULL
  1669. #endif
  1670.   (*func)(stream,"kf59",    "Fn",    TINFO, key_f59,            OFFSET(CurrTerm,str_kf59),    "kf59",        "f59 key");
  1671. #ifndef key_f60
  1672. #define key_f60 NULL
  1673. #endif
  1674.   (*func)(stream,"kf60",    "Fo",    TINFO, key_f60,            OFFSET(CurrTerm,str_kf60),    "kf60",        "f60 key");
  1675. #ifndef key_f61
  1676. #define key_f61 NULL
  1677. #endif
  1678.   (*func)(stream,"kf61",    "Fp",    TINFO, key_f61,            OFFSET(CurrTerm,str_kf61),    "kf61",        "f61 key");
  1679. #ifndef key_f62
  1680. #define key_f62 NULL
  1681. #endif
  1682.   (*func)(stream,"kf62",    "Fq",    TINFO, key_f62,            OFFSET(CurrTerm,str_kf62),    "kf62",        "f62 key");
  1683. #ifndef key_f63
  1684. #define key_f63 NULL
  1685. #endif
  1686.   (*func)(stream,"kf63",    "Fr",    TINFO, key_f63,            OFFSET(CurrTerm,str_kf63),    "kf63",        "f63 key");
  1687. #ifndef key_find
  1688. #define key_find NULL
  1689. #endif
  1690.   (*func)(stream,"kfnd",    "@0",    TINFO, key_find,        OFFSET(CurrTerm,str_kfnd),    "kfnd",        "fnd key");
  1691. #ifndef key_help
  1692. #define key_help NULL
  1693. #endif
  1694.   (*func)(stream,"khlp",    "%1",    TINFO, key_help,        OFFSET(CurrTerm,str_khlp),    "khlp",        "hlp key"); /* code "kq" ??? */
  1695. #ifndef key_ll
  1696. #define key_ll NULL
  1697. #endif
  1698.   (*func)(stream,"kll",        "kH",    TINFO, key_ll,            OFFSET(CurrTerm,str_kll),    "kll",        "lower left key");
  1699. #ifndef key_move
  1700. #define key_move NULL
  1701. #endif
  1702.   (*func)(stream,"kmov",    "%4",    TINFO, key_move,        OFFSET(CurrTerm,str_kmov),    "kmov",        "mov key");
  1703. #ifndef key_smap_in1
  1704. #define key_smap_in1 NULL
  1705. #endif
  1706.   (*func)(stream,"kmpf1",    "Kv",    TINFO, key_smap_in1,        OFFSET(CurrTerm,str_kmpf1),    "kmpf1",    "Input for special mapped key 1");
  1707. #ifndef key_smap_out1
  1708. #define key_smap_out1 NULL
  1709. #endif
  1710.   (*func)(stream,"kmpt1",    "KV",    TINFO, key_smap_out1,        OFFSET(CurrTerm,str_kmpt1),    "kmpt1",    "Output for mapped key 1");
  1711. #ifndef key_smap_in2
  1712. #define key_smap_in2 NULL
  1713. #endif
  1714.   (*func)(stream,"kmpf2",    "Kw",    TINFO, key_smap_in2,        OFFSET(CurrTerm,str_kmpf2),    "kmpf2",    "Input for special mapped key 2");
  1715. #ifndef key_smap_out2
  1716. #define key_smap_out2 NULL
  1717. #endif
  1718.   (*func)(stream,"kmpt2",    "KW",    TINFO, key_smap_out2,        OFFSET(CurrTerm,str_kmpt2),    "kmpt2",    "Output for mapped key 2");
  1719. #ifndef key_smap_in3
  1720. #define key_smap_in3 NULL
  1721. #endif
  1722.   (*func)(stream,"kmpf3",    "Kx",    TINFO, key_smap_in3,        OFFSET(CurrTerm,str_kmpf3),    "kmpf3",    "Input for special mapped key 3");
  1723. #ifndef key_smap_out3
  1724. #define key_smap_out3 NULL
  1725. #endif
  1726.   (*func)(stream,"kmpt3",    "KX",    TINFO, key_smap_out3,        OFFSET(CurrTerm,str_kmpt3),    "kmpt3",    "Output for mapped key 3");
  1727. #ifndef key_smap_in4
  1728. #define key_smap_in4 NULL
  1729. #endif
  1730.   (*func)(stream,"kmpf4",    "Ky",    TINFO, key_smap_in4,        OFFSET(CurrTerm,str_kmpf4),    "kmpf4",    "Input for special mapped key 4");
  1731. #ifndef key_smap_out4
  1732. #define key_smap_out4 NULL
  1733. #endif
  1734.   (*func)(stream,"kmpt4",    "KY",    TINFO, key_smap_out4,        OFFSET(CurrTerm,str_kmpt4),    "kmpt4",    "Output for mapped key 4");
  1735. #ifndef key_smap_in5
  1736. #define key_smap_in5 NULL
  1737. #endif
  1738.   (*func)(stream,"kmpf5",    "Kz",    TINFO, key_smap_in5,        OFFSET(CurrTerm,str_kmpf5),    "kmpf5",    "Input for special mapped key 5");
  1739. #ifndef key_smap_out5
  1740. #define key_smap_out5 NULL
  1741. #endif
  1742.   (*func)(stream,"kmpt5",    "KZ",    TINFO, key_smap_out5,        OFFSET(CurrTerm,str_kmpt5),    "kmpt5",    "Output for mapped key 5");
  1743. #ifndef key_mark
  1744. #define key_mark NULL
  1745. #endif
  1746.   (*func)(stream,"kmrk",    "%2",    TINFO, key_mark,        OFFSET(CurrTerm,str_kmrk),    "kmrk",        "mark key");
  1747. #ifndef key_message
  1748. #define key_message NULL
  1749. #endif
  1750.   (*func)(stream,"kmsg",    "%3",    TINFO, key_message,        OFFSET(CurrTerm,str_kmsg),    "kmsg",        "msg key");
  1751. #ifndef key_next_pane
  1752. #define key_next_pane NULL
  1753. #endif
  1754.   (*func)(stream,"knpn",    "kv",    TINFO, key_next_pane,        OFFSET(CurrTerm,str_knpn),    "knpn",        "next pane key");
  1755. #ifndef key_npage
  1756. #define key_npage NULL
  1757. #endif
  1758.   (*func)(stream,"knp",        "kN",    TINFO, key_npage,        OFFSET(CurrTerm,str_knp),    "knp",        "new page key");
  1759. #ifndef key_next
  1760. #define key_next NULL
  1761. #endif
  1762.   (*func)(stream,"knxt",    "%5",    TINFO, key_next,        OFFSET(CurrTerm,str_knxt),    "knxt",        "nxt key");
  1763. #ifndef key_open
  1764. #define key_open NULL
  1765. #endif
  1766.   (*func)(stream,"kopn",    "%6",    TINFO, key_open,        OFFSET(CurrTerm,str_kopn),    "kopn",        "opn key");
  1767. #ifndef key_options
  1768. #define key_options NULL
  1769. #endif
  1770.   (*func)(stream,"kopt",    "%7",    TINFO, key_options,        OFFSET(CurrTerm,str_kopt),    "kopt",        "opt key");
  1771. #ifndef key_prev_cmd
  1772. #define key_prev_cmd NULL
  1773. #endif
  1774.   (*func)(stream,"kpcmd",    "kp",    TINFO, key_prev_cmd,        OFFSET(CurrTerm,str_kpcmd),    "kpcmd",    "prev command key");
  1775. #ifndef key_ppage
  1776. #define key_ppage NULL
  1777. #endif
  1778.   (*func)(stream,"kpp",        "kP",    TINFO, key_ppage,        OFFSET(CurrTerm,str_kpp),    "kpp",        "pp key");
  1779. #ifndef key_prev_pane
  1780. #define key_prev_pane NULL
  1781. #endif
  1782.   (*func)(stream,"kppn",    "kV",    TINFO, key_prev_pane,        OFFSET(CurrTerm,str_kppn),    "kppn",        "prev pane key");
  1783. #ifndef key_print
  1784. #define key_print NULL
  1785. #endif
  1786.   (*func)(stream,"kprt",    "%9",    TINFO, key_print,        OFFSET(CurrTerm,str_kprt),    "kprt",        "prt key");
  1787. #ifndef key_previous
  1788. #define key_previous NULL
  1789. #endif
  1790.   (*func)(stream,"kprv",    "%8",    TINFO, key_previous,        OFFSET(CurrTerm,str_kprv),    "kprv",        "prv key");
  1791. #ifndef key_quit
  1792. #define key_quit NULL
  1793. #endif
  1794.   (*func)(stream,"kpquit",    "kQ",    TINFO, key_quit,        OFFSET(CurrTerm,str_kpquit),    "kpquit",    "quit key");
  1795. #ifndef key_redo
  1796. #define key_redo NULL
  1797. #endif
  1798.   (*func)(stream,"krdo",    "%0",    TINFO, key_redo,        OFFSET(CurrTerm,str_krdo),    "krdo",        "redo key");
  1799. #ifndef key_reference
  1800. #define key_reference NULL
  1801. #endif
  1802.   (*func)(stream,"kref",    "&1",    TINFO, key_reference,        OFFSET(CurrTerm,str_kref),    "kref",        "reference key");
  1803. #ifndef key_resume
  1804. #define key_resume NULL
  1805. #endif
  1806.   (*func)(stream,"kres",    "&5",    TINFO, key_resume,        OFFSET(CurrTerm,str_kres),    "kres",        "resume key");
  1807. #ifndef key_refresh
  1808. #define key_refresh NULL
  1809. #endif
  1810.   (*func)(stream,"krfr",    "&2",    TINFO, key_refresh,        OFFSET(CurrTerm,str_krfr),    "krfr",        "refresh key");
  1811. #ifndef key_replace
  1812. #define key_replace NULL
  1813. #endif
  1814.   (*func)(stream,"krpl",    "&3",    TINFO, key_replace,        OFFSET(CurrTerm,str_krpl),    "krpl",        "replace key");
  1815. #ifndef key_restart
  1816. #define key_restart NULL
  1817. #endif
  1818.   (*func)(stream,"krst",    "&4",    TINFO, key_restart,        OFFSET(CurrTerm,str_krst),    "krst",        "restart key");
  1819. #ifndef key_save
  1820. #define key_save NULL
  1821. #endif
  1822.   (*func)(stream,"ksav",    "&6",    TINFO, key_save,        OFFSET(CurrTerm,str_ksav),    "ksav",        "save key");
  1823. #ifndef key_select
  1824. #define key_select NULL
  1825. #endif
  1826.   (*func)(stream,"kslt",    "*6",    TINFO, key_select,        OFFSET(CurrTerm,str_kslt),    "kslt",        "select key");
  1827. #ifndef key_suspend
  1828. #define key_suspend NULL
  1829. #endif
  1830.   (*func)(stream,"kspd",    "&7",    TINFO, key_suspend,        OFFSET(CurrTerm,str_kspd),    "kspd",        "suspend key");
  1831. #ifndef key_undo
  1832. #define key_undo NULL
  1833. #endif
  1834.   (*func)(stream,"kund",    "&8",    TINFO, key_undo,        OFFSET(CurrTerm,str_kund),    "kund",        "undo key");
  1835. #ifndef lab_f0
  1836. #define lab_f0 NULL
  1837. #endif
  1838.   (*func)(stream,"lf0",        "l0",    TINFO, lab_f0,        OFFSET(CurrTerm,str_lf0),    "lf0",    "labels on function key f0 inf not f0");
  1839. #ifndef lab_f1
  1840. #define lab_f1 NULL
  1841. #endif
  1842.   (*func)(stream,"lf1",        "l1",    TINFO, lab_f1,        OFFSET(CurrTerm,str_lf1),    "lf1",    "labels on function key f1 inf not f1");
  1843. #ifndef lab_f2
  1844. #define lab_f2 NULL
  1845. #endif
  1846.   (*func)(stream,"lf2",        "l2",    TINFO, lab_f2,        OFFSET(CurrTerm,str_lf2),    "lf2",    "labels on function key f2 inf not f2");
  1847. #ifndef lab_f3
  1848. #define lab_f3 NULL
  1849. #endif
  1850.   (*func)(stream,"lf3",        "l3",    TINFO, lab_f3,        OFFSET(CurrTerm,str_lf3),    "lf3",    "labels on function key f3 inf not f3");
  1851. #ifndef lab_f4
  1852. #define lab_f4 NULL
  1853. #endif
  1854.   (*func)(stream,"lf4",        "l4",    TINFO, lab_f4,        OFFSET(CurrTerm,str_lf4),    "lf4",    "labels on function key f4 inf not f4");
  1855. #ifndef lab_f5
  1856. #define lab_f5 NULL
  1857. #endif
  1858.   (*func)(stream,"lf5",        "l5",    TINFO, lab_f5,        OFFSET(CurrTerm,str_lf5),    "lf5",    "labels on function key f5 inf not f5");
  1859. #ifndef lab_f6
  1860. #define lab_f6 NULL
  1861. #endif
  1862.   (*func)(stream,"lf6",        "l6",    TINFO, lab_f6,        OFFSET(CurrTerm,str_lf6),    "lf6",    "labels on function key f6 inf not f6");
  1863. #ifndef lab_f7
  1864. #define lab_f7 NULL
  1865. #endif
  1866.   (*func)(stream,"lf7",        "l7",    TINFO, lab_f7,        OFFSET(CurrTerm,str_lf7),    "lf7",    "labels on function key f7 inf not f7");
  1867. #ifndef lab_f8
  1868. #define lab_f8 NULL
  1869. #endif
  1870.   (*func)(stream,"lf8",        "l8",    TINFO, lab_f8,        OFFSET(CurrTerm,str_lf8),    "lf8",    "labels on function key f8 inf not f8");
  1871. #ifndef lab_f9
  1872. #define lab_f9 NULL
  1873. #endif
  1874.   (*func)(stream,"lf9",        "l9",    TINFO, lab_f9,        OFFSET(CurrTerm,str_lf9),    "lf9",    "labels on function key f9 inf not f9");
  1875. #ifndef lab_f10
  1876. #define lab_f10 NULL
  1877. #endif
  1878.   (*func)(stream,"lf10",    "la",    TINFO, lab_f10,        OFFSET(CurrTerm,str_lf10),    "lf10",    "labels on function key f10 inf not f10");
  1879. #ifndef pad_char
  1880. #define pad_char NULL
  1881. #endif
  1882.   (*func)(stream,"pad",        "pc",    TINFO, pad_char,    OFFSET(CurrTerm,str_pad),    "pad",        "pad char other than NULL");
  1883. #ifndef reset_file
  1884. #define reset_file NULL
  1885. #endif
  1886.   (*func)(stream,"rf",        "rf",    TINFO, reset_file,    OFFSET(CurrTerm,str_rf),    "rf",        "name of file containing reset string");
  1887. #ifndef char_padding
  1888. #define char_padding NULL
  1889. #endif
  1890.   (*func)(stream,"rmp",        "rP",    TINFO, char_padding,    OFFSET(CurrTerm,str_rmp),    "rmp",        "char padding time if not in insert mode");
  1891. #ifndef xoff_character
  1892. #define xoff_character NULL
  1893. #endif
  1894.   (*func)(stream,"xoffc",    "XF",    TINFO, xoff_character,    OFFSET(CurrTerm,str_xoffc),    "xoffc",    "xoff character");
  1895. #ifndef xon_character
  1896. #define xon_character NULL
  1897. #endif
  1898.   (*func)(stream,"xonc",    "XN",    TINFO, xon_character,    OFFSET(CurrTerm,str_xonc),    "xonc",        "xon character");
  1899. #ifndef acs_chars
  1900. #define acs_chars NULL
  1901. #endif
  1902.   (*func)(stream,"acsc",    "ac",    TINFO, acs_chars,     OFFSET(CurrTerm,str_acsc),    "acsc",        "Alternate char set pairs");
  1903. #ifndef key_newline
  1904. #define key_newline NULL
  1905. #endif
  1906.   (*func)(stream,"knl",        "kn",    TINFO, key_newline,        OFFSET(CurrTerm,str_knl),    "knl",        "nl key");
  1907. #ifndef key_clear
  1908. #define key_clear NULL
  1909. #endif
  1910.   (*func)(stream,"kclr",    "kC",    TINFO, key_clear,    OFFSET(CurrTerm,str_kclr),    "kclr",        "clr key");
  1911. #ifndef key_left
  1912. #define key_left NULL
  1913. #endif
  1914.   (*func)(stream,"kcub1",    "kl",    TINFO, key_left,    OFFSET(CurrTerm,str_kcub1),    "kcub1",    "left key");
  1915. #ifndef key_down
  1916. #define key_down NULL
  1917. #endif
  1918.   (*func)(stream,"kcud1",    "kd",    TINFO, key_down,    OFFSET(CurrTerm,str_kcud1),    "kcud1",    "down key");
  1919. #ifndef key_right
  1920. #define key_right NULL
  1921. #endif
  1922.   (*func)(stream,"kcuf1",    "kr",    TINFO, key_right,    OFFSET(CurrTerm,str_kcuf1),    "kcuf1",    "right key");
  1923. #ifndef key_up
  1924. #define key_up NULL
  1925. #endif
  1926.   (*func)(stream,"kcuu1",    "ku",    TINFO, key_up,        OFFSET(CurrTerm,str_kcuu1),    "kcuu1",    "up key");
  1927. #ifndef key_dc
  1928. #define key_dc NULL
  1929. #endif
  1930.   (*func)(stream,"kdch1",    "kD",    TINFO, key_dc,        OFFSET(CurrTerm,str_kdch1),    "kdch1",    "delete key");
  1931. #ifndef key_dl
  1932. #define key_dl NULL
  1933. #endif
  1934.   (*func)(stream,"kdl1",    "kL",    TINFO, key_dl,        OFFSET(CurrTerm,str_kdl1),    "kdl1",        "dl1 key");
  1935. #ifndef key_eos
  1936. #define key_eos NULL
  1937. #endif
  1938.   (*func)(stream,"ked",        "kS",    TINFO, key_eos,        OFFSET(CurrTerm,str_ked),    "ked",        "clear to eos");
  1939. #ifndef key_eol
  1940. #define key_eol NULL
  1941. #endif
  1942.   (*func)(stream,"kel",        "kE",    TINFO, key_eol,        OFFSET(CurrTerm,str_kel),    "kel",        "clear to end of line");
  1943. #ifndef key_home
  1944. #define key_home NULL
  1945. #endif
  1946.   (*func)(stream,"khome",    "kh",    TINFO, key_home,    OFFSET(CurrTerm,str_khome),    "khome",    "home key");
  1947. #ifndef key_stab
  1948. #define key_stab NULL
  1949. #endif
  1950.   (*func)(stream,"khts",    "kT",    TINFO, key_stab,    OFFSET(CurrTerm,str_khts),    "khts",        "set tab key");
  1951. #ifndef key_ic
  1952. #define key_ic NULL
  1953. #endif
  1954.   (*func)(stream,"kich1",    "kI",    TINFO, key_ic,        OFFSET(CurrTerm,str_kich1),    "kich1",    "insert key");
  1955. #ifndef key_il
  1956. #define key_il NULL
  1957. #endif
  1958.   (*func)(stream,"kil1",    "kA",    TINFO, key_il,        OFFSET(CurrTerm,str_kil1),    "kil1",        "il key");
  1959. #ifndef key_sf
  1960. #define key_sf NULL
  1961. #endif
  1962.   (*func)(stream,"kind",    "kF",    TINFO, key_sf,        OFFSET(CurrTerm,str_kind),    "kind",        "scroll fwd/up key");
  1963. #ifndef key_sr
  1964. #define key_sr NULL
  1965. #endif
  1966.   (*func)(stream,"kri",        "kR",    TINFO, key_sr,        OFFSET(CurrTerm,str_kri),    "kri",        "scroll up key");
  1967. #ifndef key_eic
  1968. #define key_eic NULL
  1969. #endif
  1970.   (*func)(stream,"krmir",    "kM",    TINFO, key_eic,        OFFSET(CurrTerm,str_krmir),    "krmir",    "exit insert mode key");
  1971. #ifndef key_scroll_left
  1972. #define key_scroll_left NULL
  1973. #endif
  1974.   (*func)(stream,"kscl",    "kz",    TINFO, key_scroll_left,    OFFSET(CurrTerm,str_kscl),    "kscl",        "scroll left key");
  1975. #ifndef key_scroll_right
  1976. #define key_scroll_right NULL
  1977. #endif
  1978.   (*func)(stream,"kscr",    "kZ",    TINFO, key_scroll_right,OFFSET(CurrTerm,str_kscr),    "kscr",        "scroll right key");
  1979. #ifndef key_tab
  1980. #define key_tab NULL
  1981. #endif
  1982.   (*func)(stream,"ktab",    "ko",    TINFO, key_tab,        OFFSET(CurrTerm,str_ktab),    "ktab",        "tab key");
  1983. #ifndef key_catab
  1984. #define key_catab NULL
  1985. #endif
  1986.   (*func)(stream,"ktbc",    "ka",    TINFO, key_catab,    OFFSET(CurrTerm,str_ktbc),    "ktbc",        "clear all tabs key");
  1987.  
  1988.   (*func)(stream,"use",        NULL,    TINFO, NULL,          OFFSET(CurrTerm,str_use),    "use",    "user other terminal description");
  1989.  
  1990.   /* string capabilities */
  1991.  
  1992. /* list higher priority ones first */
  1993. #ifndef back_tab
  1994. #define back_tab NULL
  1995. #endif
  1996.   (*func)(stream,"cbt",        "bt",    TSTRING, back_tab,        do_backtab,    "do_backtab",    "cursor back tab");
  1997. #ifndef newline
  1998. #define newline NULL
  1999. #endif
  2000.   (*func)(stream,"nel",    "nw",    TSTRING, newline,        do_newline,    "do_newline",    "beginning of next line");
  2001. #ifndef scroll_forward
  2002. #define scroll_forward NULL
  2003. #endif
  2004.   (*func)(stream,"ind",    "sf",    TSTRING, scroll_forward,    do_scroll_forward,    "do_scroll_forward",    "scroll fwd/up");
  2005. #ifndef exit_attribute_mode
  2006. #define exit_attribute_mode NULL
  2007. #endif
  2008.   (*func)(stream,"sgr0",    "me",    TSTRING, exit_attribute_mode,    do_normal,    "do_normal",    "turn off all attributes");
  2009. #ifndef bell
  2010. #define bell NULL
  2011. #endif
  2012.   (*func)(stream,"bel",    "bl",    TSTRING, bell,            do_bell,    "do_bell",    "bell");
  2013. #ifndef enter_blink_mode
  2014. #define enter_blink_mode NULL
  2015. #endif
  2016.   (*func)(stream,"blink",    "mb",    TSTRING, enter_blink_mode,    do_blink,    "do_blink",    "enter blink mode");
  2017. #ifndef enter_bold_mode
  2018. #define enter_bold_mode NULL
  2019. #endif
  2020.   (*func)(stream,"bold",    "md",    TSTRING, enter_bold_mode,    do_bold,    "do_bold",    "enter bold mode");
  2021. #ifndef cursor_invisible
  2022. #define cursor_invisible NULL
  2023. #endif
  2024.   (*func)(stream,"civis",    "vi",    TSTRING, cursor_invisible,    do_cursor_invisible,    "do_cursor_invisible",    "cursor invisible");
  2025. #ifndef clear_screen
  2026. #define clear_screen NULL
  2027. #endif
  2028.   (*func)(stream,"clear",    "cl",    TSTRING, clear_screen,        do_clear,    "do_clear",    "Clear entire screen then home");
  2029. #ifndef cursor_normal
  2030. #define cursor_normal NULL
  2031. #endif
  2032.   (*func)(stream,"cnorm",    "ve",    TSTRING, cursor_normal,        do_cursor_normal,    "do_cursor_normal",    "cursor normal");
  2033. #ifndef carriage_return
  2034. #define carriage_return NULL
  2035. #endif
  2036.   (*func)(stream,"cr",    "cr",    TSTRING, carriage_return,    do_carriage_return,    "do_carriage_return",    "carriage-return");
  2037. #ifndef change_scroll_region
  2038. #define change_scroll_region NULL
  2039. #endif
  2040.   (*func)(stream,"csr",    "cs",    TSTRING, change_scroll_region,    do_set_scroll_region,    "do_set_scroll_region",    "change scroll region");
  2041. #ifndef parm_left_cursor
  2042. #define parm_left_cursor NULL
  2043. #endif
  2044.   (*func)(stream,"cub",    "LE",    TSTRING, parm_left_cursor,    do_curse_back,    "do_curse_back",    "Move Left N places");
  2045. #ifndef cursor_left
  2046. #define cursor_left NULL
  2047. #endif
  2048.   (*func)(stream,"cub1",    "le",    TSTRING, cursor_left,        do_curse_back,    "do_curse_back",    "cursor back 1");
  2049. #ifndef parm_down_cursor
  2050. #define parm_down_cursor NULL
  2051. #endif
  2052.   (*func)(stream,"cud",    "DO",    TSTRING, parm_down_cursor,    do_curse_down,    "do_curse_down",    "Move down N places");
  2053. #ifndef cursor_down
  2054. #define cursor_down NULL
  2055. #endif
  2056.   (*func)(stream,"cud1",    "do",    TSTRING, cursor_down,        do_curse_down,    "do_curse_down",    "cursor down 1");
  2057. #ifndef parm_right_cursor
  2058. #define parm_right_cursor NULL
  2059. #endif
  2060.   (*func)(stream,"cuf",    "RI",    TSTRING, parm_right_cursor,    do_curse_forward,    "do_curse_forward",    "Move right N places");
  2061. #ifndef cursor_right
  2062. #define cursor_right NULL
  2063. #endif
  2064.   (*func)(stream,"cuf1",    "nd",    TSTRING, cursor_right,        do_curse_forward,    "do_curse_forward",    "cursor forward 1");
  2065. #ifndef cursor_address
  2066. #define cursor_address NULL
  2067. #endif
  2068.   (*func)(stream,"cup",    "cm",    TSTRING, cursor_address,    do_set_cursor,    "do_set_cursor",    "Cursor to X/Y");
  2069. #ifndef parm_up_cursor
  2070. #define parm_up_cursor NULL
  2071. #endif
  2072.   (*func)(stream,"cuu",    "UP",    TSTRING, parm_up_cursor,    do_curse_up,    "do_curse_up",    "Move up N places");
  2073. #ifndef cursor_up
  2074. #define cursor_up NULL
  2075. #endif
  2076.   (*func)(stream,"cuu1",    "up",    TSTRING, cursor_up,        do_curse_up,    "do_curse_up",    "cursor up 1");
  2077. #ifndef cursor_visible
  2078. #define cursor_visible NULL
  2079. #endif
  2080.   (*func)(stream,"cvvis",    "vs",    TSTRING, cursor_visible,    do_cursor_brighter,    "do_cursor_brighter",    "cursor brighter");
  2081. #ifndef parm_dch
  2082. #define parm_dch NULL
  2083. #endif
  2084.   (*func)(stream,"dch",    "DC",    TSTRING, parm_dch,        do_delete_chars,    "do_delete_chars",    "delete N chars");
  2085. #ifndef delete_character
  2086. #define delete_character NULL
  2087. #endif
  2088.   (*func)(stream,"dch1",    "dc",    TSTRING, delete_character,    do_delete_chars,    "do_delete_chars",    "delete 1 char");
  2089. #ifndef enter_dim_mode
  2090. #define enter_dim_mode NULL
  2091. #endif
  2092.   (*func)(stream,"dim",    "mh",    TSTRING, enter_dim_mode,    do_dim,    "do_dim",    "dim");
  2093. #ifndef parm_delete_line
  2094. #define parm_delete_line NULL
  2095. #endif
  2096.   (*func)(stream,"dl",    "DL",    TSTRING, parm_delete_line,    do_delete_line,    "do_delete_line",    "delete N lines ,shift up lines below");
  2097. #ifndef delete_line
  2098. #define delete_line NULL
  2099. #endif
  2100.   (*func)(stream,"dl1",    "dl",    TSTRING, delete_line,        do_delete_line,    "do_delete_line",    "delete curr line ,shift up lines below");
  2101. #ifndef dis_status_line
  2102. #define dis_status_line NULL
  2103. #endif
  2104.   (*func)(stream,"dsl",    "ds",    TSTRING, dis_status_line,    do_display_status,    "do_display_status",    "display status line");
  2105. #ifndef erase_chars
  2106. #define erase_chars NULL
  2107. #endif
  2108.   (*func)(stream,"ech",    "ec",    TSTRING, erase_chars,        do_erase_chars,    "do_erase_chars",    "Erase N characters without moving cursor");
  2109. #ifndef clr_eos
  2110. #define clr_eos NULL
  2111. #endif
  2112.   (*func)(stream,"ed",    "cd",    TSTRING, clr_eos,        do_clear_to_eos,    "do_clear_to_eos",    "clear to end of display ,no move");
  2113. #ifndef clr_eol
  2114. #define clr_eol NULL
  2115. #endif
  2116.   (*func)(stream,"el",    "ce",    TSTRING, clr_eol,        do_clear_to_eol,    "do_clear_to_eol",    "clear to eol no move");
  2117. #ifndef clr_bol
  2118. #define clr_bol NULL
  2119. #endif
  2120.   (*func)(stream,"eli",    "cb",    TSTRING, clr_bol,        do_clear_to_bol,    "do_clear_to_bol",    "clear bol to curpos ,no move");
  2121. /*(*func)(stream,"el1",    "cb",    TSTRING, clr_bol,        do_clear_to_bol,    "do_clear_to_bol",    "clear bol to curpos ,no mv");*/
  2122. #ifndef ena_acs
  2123. #define ena_acs NULL
  2124. #endif
  2125.   (*func)(stream,"enacs",    "eA",    TSTRING, ena_acs,        do_enable_altchar_mode,    "do_enable_altchar_mode",    "enable alternate char set");
  2126. #ifndef form_feed
  2127. #define form_feed NULL
  2128. #endif
  2129.   (*func)(stream,"ff",    "ff",    TSTRING, form_feed,        do_formfeed,    "do_formfeed",    "form feed");
  2130. #ifndef flash_screen
  2131. #define flash_screen NULL
  2132. #endif
  2133.   (*func)(stream,"flash",    "vb",    TSTRING, flash_screen,        do_visible_bell,    "do_visible_bell",    "visible bell");
  2134. #ifndef font_0
  2135. #define font_0 NULL
  2136. #endif
  2137.   (*func)(stream,"font0",    "f0",    TSTRING, font_0,        do_font0,    "do_font0",    "Select font 0");
  2138. #ifndef font_1
  2139. #define font_1 NULL
  2140. #endif
  2141.   (*func)(stream,"font1",    "f1",    TSTRING, font_1,        do_font1,    "do_font1",    "Select font 1");
  2142. #ifndef font_2
  2143. #define font_2 NULL
  2144. #endif
  2145.   (*func)(stream,"font2",    "f2",    TSTRING, font_2,        do_font2,    "do_font2",    "Select font 2");
  2146. #ifndef font_3
  2147. #define font_3 NULL
  2148. #endif
  2149.   (*func)(stream,"font3",    "f3",    TSTRING, font_3,        do_font3,    "do_font3",    "Select font 3");
  2150. #ifndef font_4
  2151. #define font_4 NULL
  2152. #endif
  2153.   (*func)(stream,"font4",    "f4",    TSTRING, font_4,        do_font4,    "do_font4",    "Select font 4");
  2154. #ifndef font_5
  2155. #define font_5 NULL
  2156. #endif
  2157.   (*func)(stream,"font5",    "f5",    TSTRING, font_5,        do_font5,    "do_font5",    "Select font 5");
  2158. #ifndef font_6
  2159. #define font_6 NULL
  2160. #endif
  2161.   (*func)(stream,"font6",    "f6",    TSTRING, font_6,        do_font6,    "do_font6",    "Select font 6");
  2162. #ifndef font_7
  2163. #define font_7 NULL
  2164. #endif
  2165.   (*func)(stream,"font7",    "f7",    TSTRING, font_7,        do_font7,    "do_font7",    "Select font 7");
  2166. #ifndef from_status_line
  2167. #define from_status_line NULL
  2168. #endif
  2169.   (*func)(stream,"fsl",    "fs",    TSTRING, from_status_line,    do_return_from_status,    "do_return_from_status",    "return from status line");
  2170. #ifndef down_half_line
  2171. #define down_half_line NULL
  2172. #endif
  2173.   (*func)(stream,"hd",    "hd",    TSTRING, down_half_line,    do_cursor_down_half_line,    "do_cursor_down_half_line",    "cursor down half line");
  2174. #ifndef cursor_home
  2175. #define cursor_home NULL
  2176. #endif
  2177.   (*func)(stream,"home",    "ho",    TSTRING, cursor_home,        do_home,    "do_home",    "cursor up left corner");
  2178. #ifndef column_address
  2179. #define column_address NULL
  2180. #endif
  2181.   (*func)(stream,"hpa",    "ch",    TSTRING, column_address,    do_set_cursor_column,    "do_set_cursor_column",    "Move to column N");
  2182. #ifndef tab
  2183. #define tab NULL
  2184. #endif
  2185.   (*func)(stream,"ht",    "ta",    TSTRING, tab,            do_tab,    "do_tab",    "hardware tab");
  2186. #ifndef set_tab
  2187. #define set_tab NULL
  2188. #endif
  2189.   (*func)(stream,"hts",    "st",    TSTRING, set_tab,        do_set_tab_stop,    "do_set_tab_stop",    "set tab stops");
  2190. #ifndef up_half_line
  2191. #define up_half_line NULL
  2192. #endif
  2193.   (*func)(stream,"hu",    "hu",    TSTRING, up_half_line,        do_cursor_up_half_line,    "do_cursor_up_half_line",    "cursor up half line");
  2194. #ifndef parm_ich
  2195. #define parm_ich NULL
  2196. #endif
  2197.   (*func)(stream,"ich",    "IC",    TSTRING, parm_ich,        do_insert_chars,    "do_insert_chars",    "insert N characters");
  2198. #ifndef insert_character
  2199. #define insert_character NULL
  2200. #endif
  2201.   (*func)(stream,"ich1",    "ic",    TSTRING, insert_character,    do_insert_chars,    "do_insert_chars",    "insert following char");
  2202. #ifndef parm_insert_line
  2203. #define parm_insert_line NULL
  2204. #endif
  2205.   (*func)(stream,"il",    "AL",    TSTRING, parm_insert_line,    do_insert_line,    "do_insert_line",    "insert N blank lines above curs at prev nl");
  2206. #ifndef insert_line
  2207. #define insert_line NULL
  2208. #endif
  2209.   (*func)(stream,"il1",    "al",    TSTRING, insert_line,        do_insert_line,    "do_insert_line",    "insert blank above curs at start new line");
  2210. #ifndef parm_index
  2211. #define parm_index NULL
  2212. #endif
  2213.   (*func)(stream,"indn",    "SF",    TSTRING, parm_index,        do_scroll_forward,    "do_scroll_forward",    "scroll forward/up N lines");
  2214. #ifndef enter_secure_mode
  2215. #define enter_secure_mode NULL
  2216. #endif
  2217.   (*func)(stream,"invis",    "mk",    TSTRING, enter_secure_mode,    do_invisible,    "do_invisible",    "enter_secure_mode");
  2218. #ifndef init_1string
  2219. #define init_1string NULL
  2220. #endif
  2221.   (*func)(stream,"is1",        "i1",    TSTRING, init_1string,        do_reset,    "do_reset",        "secondary term init string");
  2222. #ifndef init_2string
  2223. #define init_2string NULL
  2224. #endif
  2225. /*  (*func)(stream,"is2",    "i2",    TSTRING, init_2string,        do_reset,    "do_reset",    "Main Term init string"); */
  2226.   (*func)(stream,"is2",    "is",    TSTRING, init_2string,        do_reset,    "do_reset",    "Main Term init string");
  2227. #ifndef init_3string
  2228. #define init_3string NULL
  2229. #endif
  2230.   (*func)(stream,"is3",        "i3",    TSTRING, init_3string,        do_reset,    "do_reset",        "Secondary term init string");
  2231. #ifndef cursor_to_ll
  2232. #define cursor_to_ll NULL
  2233. #endif
  2234.   (*func)(stream,"ll",    "ll",    TSTRING, cursor_to_ll,        do_lower_left,    "do_lower_left",    "Move to lower left");
  2235. #ifndef clear_margins
  2236. #define clear_margins NULL
  2237. #endif
  2238.   (*func)(stream,"mgc",    "MC",    TSTRING, clear_margins,        do_clear_soft_margins,    "do_clear_soft_margins",    "clear left and right soft margins");
  2239. #ifndef pkey_key
  2240. #define pkey_key NULL
  2241. #endif
  2242.   (*func)(stream,"pfkey",    "pk",    TSTRING, pkey_key,        do_program_type,    "do_program_type",    "Program funct key #1 to type string #2");
  2243. #ifndef pkey_local
  2244. #define pkey_local NULL
  2245. #endif
  2246.   (*func)(stream,"pfloc",    "pl",    TSTRING, pkey_local,        do_program_local,    "do_program_local",    "Program funct key #1 to execute string #2");
  2247. #ifndef pkey_xmit
  2248. #define pkey_xmit NULL
  2249. #endif
  2250.   (*func)(stream,"pfx",    "px",    TSTRING, pkey_xmit,        do_program_xmit,    "do_program_xmit",    "Program funct key #1 to transmit string #2");
  2251. #ifndef plab_norm
  2252. #define plab_norm NULL
  2253. #endif
  2254.   (*func)(stream,"pln",    "pn",    TSTRING, plab_norm,        do_program_label,    "do_program_label",    "Program label #1 to show string #2");
  2255. #ifndef enter_protected_mode
  2256. #define enter_protected_mode NULL
  2257. #endif
  2258.   (*func)(stream,"prot",    "mp",    TSTRING, enter_protected_mode,    do_protect,    "do_protect",    "Enter protected mode");
  2259. #ifndef restore_cursor
  2260. #define restore_cursor NULL
  2261. #endif
  2262.   (*func)(stream,"rc",    "rc",    TSTRING, restore_cursor,    do_restore_cursor,    "do_restore_cursor",    "restore cursor from saved pos");
  2263. #ifndef repeat_char
  2264. #define repeat_char NULL
  2265. #endif
  2266.   (*func)(stream,"rep",    "rp",    TSTRING, repeat_char,        do_repeat_char,    "do_repeat_char",    "char #1 is repeated #2 times");
  2267. #ifndef enter_reverse_mode
  2268. #define enter_reverse_mode NULL
  2269. #endif
  2270.   (*func)(stream,"rev",    "mr",    TSTRING, enter_reverse_mode,    do_reverse,    "do_reverse",    "enter reverse video mode");
  2271. #ifndef req_for_input
  2272. #define req_for_input NULL
  2273. #endif
  2274.   (*func)(stream,"rfi",    "RF",    TSTRING, req_for_input,        do_request_for_input,    "do_request_for_input",    "send next char (for pty)");
  2275. #ifndef scroll_reverse
  2276. #define scroll_reverse NULL
  2277. #endif
  2278.   (*func)(stream,"ri",    "sr",    TSTRING, scroll_reverse,    do_scroll_reverse,    "do_scroll_reverse",    "scroll text down 1 line");
  2279. #ifndef parm_rindex
  2280. #define parm_rindex NULL
  2281. #endif
  2282.   (*func)(stream,"rin",    "SR",    TSTRING, parm_rindex,        do_scroll_reverse,    "do_scroll_reverse",    "scroll text down N lines");
  2283. #ifndef exit_alt_charset_mode
  2284. #define exit_alt_charset_mode NULL
  2285. #endif
  2286.   (*func)(stream,"rmacs",    "ae",    TSTRING, exit_alt_charset_mode,    do_noaltcharset,    "do_noaltcharset",    "end alt charset mode");
  2287. #ifndef exit_am_mode
  2288. #define exit_am_mode NULL
  2289. #endif
  2290.   (*func)(stream,"rmam",    "RA",    TSTRING, exit_am_mode,        do_exit_automatic_margin_mode,    "do_exit_automatic_margin_mode",    "turn off automatic margins");
  2291. #ifndef exit_ca_mode
  2292. #define exit_ca_mode NULL
  2293. #endif
  2294.   (*func)(stream,"rmcup",    "te",    TSTRING, exit_ca_mode,        do_exit_cursor_addressing_mode,    "do_exit_cursor_addressing_mode",    "End programs that use cup");
  2295. #ifndef exit_delete_mode
  2296. #define exit_delete_mode NULL
  2297. #endif
  2298.   (*func)(stream,"rmdc",    "ed",    TSTRING, exit_delete_mode,    do_exit_delete_mode,    "do_exit_delete_mode",    "exit delete mode");
  2299. #ifndef exit_insert_mode
  2300. #define exit_insert_mode NULL
  2301. #endif
  2302.   (*func)(stream,"rmir",    "ei",    TSTRING, exit_insert_mode,    do_exit_insert_mode,    "do_exit_insert_mode",    "exit insert mode");
  2303. #ifndef keypad_local
  2304. #define keypad_local NULL
  2305. #endif
  2306.   (*func)(stream,"rmkx",    "ke",    TSTRING, keypad_local,        do_stop_keypad,    "do_stop_keypad",    "end keypad transmit mode");
  2307. #ifndef label_off
  2308. #define label_off NULL
  2309. #endif
  2310.   (*func)(stream,"rmln",    "LF",    TSTRING, label_off,        do_disable_soft_labels,    "do_disable_soft_labels",    "turn off soft labels");
  2311. #ifndef meta_off
  2312. #define meta_off NULL
  2313. #endif
  2314.   (*func)(stream,"rmm",    "mo",    TSTRING, meta_off,        do_exit_meta_mode,    "do_exit_meta_mode",    "turn off meta mode");
  2315. #ifndef exit_standout_mode
  2316. #define exit_standout_mode NULL
  2317. #endif
  2318.   (*func)(stream,"rmso",    "se",    TSTRING, exit_standout_mode,    do_nostandout,    "do_nostandout",    "exit standout mode");
  2319. #ifndef exit_underline_mode
  2320. #define exit_underline_mode NULL
  2321. #endif
  2322.   (*func)(stream,"rmul",    "ue",    TSTRING, exit_underline_mode,    do_nounderline,    "do_nounderline",    "exit underline mode");
  2323. #ifndef exit_xon_mode
  2324. #define exit_xon_mode NULL
  2325. #endif
  2326.   (*func)(stream,"rmxon",    "RX",    TSTRING, exit_xon_mode,        do_exit_xon_xoff_mode,    "do_exit_xon_xoff_mode",    "exit xon/xoff mode");
  2327. #ifndef reset_1string
  2328. #define reset_1string NULL
  2329. #endif
  2330.   (*func)(stream,"rs1",    "r1",    TSTRING, reset_1string,        do_reset,    "do_reset",    "reset term completely to sane modes");
  2331. #ifndef reset_2string
  2332. #define reset_2string NULL
  2333. #endif
  2334.   (*func)(stream,"rs2",    "r2",    TSTRING, reset_2string,        do_reset,    "do_reset",    "reset term completely to sane modes");
  2335. #ifndef reset_3string
  2336. #define reset_3string NULL
  2337. #endif
  2338.   (*func)(stream,"rs3",    "r3",    TSTRING, reset_3string,        do_reset,    "do_reset",    "reset term completely to sane modes");
  2339. #ifndef save_cursor
  2340. #define save_cursor NULL
  2341. #endif
  2342.   (*func)(stream,"sc",    "sc",    TSTRING, save_cursor,        do_save_cursor,    "do_save_cursor",    "save cursor");
  2343. #ifndef set_attributes
  2344. #define set_attributes NULL
  2345. #endif
  2346.   (*func)(stream,"sgr",    "sa",    TSTRING, set_attributes,    do_sgr,    "do_sgr",    "define video attributes");
  2347. #ifndef enter_alt_charset_mode
  2348. #define enter_alt_charset_mode NULL
  2349. #endif
  2350.   (*func)(stream,"smacs",    "as",    TSTRING, enter_alt_charset_mode,do_altcharset,    "do_altcharset",    "enter alt charset mode");
  2351. #ifndef enter_am_mode
  2352. #define enter_am_mode NULL
  2353. #endif
  2354.   (*func)(stream,"smam",    "SA",    TSTRING, enter_am_mode,        do_enter_automatic_margin_mode,    "do_enter_automatic_margin_mode",    "turn on automatic margins");
  2355. #ifndef enter_ca_mode
  2356. #define enter_ca_mode NULL
  2357. #endif
  2358.   (*func)(stream,"smcup",    "ti",    TSTRING, enter_ca_mode,        do_enter_cursor_addressing_mode,    "do_enter_cursor_addressing_mode",    "Set cursor addressing mode (cup)");
  2359. #ifndef enter_delete_mode
  2360. #define enter_delete_mode NULL
  2361. #endif
  2362.   (*func)(stream,"smdc",    "dm",    TSTRING, enter_delete_mode,    do_enter_delete_mode,    "do_enter_delete_mode",    "enter delete mode");
  2363. #ifndef set_left_margin
  2364. #define set_left_margin NULL
  2365. #endif
  2366.   (*func)(stream,"smgl",    "ML",    TSTRING, set_left_margin,    do_set_left_margin,    "do_set_left_margin",    "Set soft left margin");
  2367. #ifndef set_right_margin
  2368. #define set_right_margin NULL
  2369. #endif
  2370.   (*func)(stream,"smgr",    "MR",    TSTRING, set_right_margin,    do_set_right_margin,    "do_set_right_margin",    "Set soft right margin");
  2371. #ifndef enter_insert_mode
  2372. #define enter_insert_mode NULL
  2373. #endif
  2374.   (*func)(stream,"smir",    "im",    TSTRING, enter_insert_mode,    do_enter_insert_mode,    "do_enter_insert_mode",    "enter insert mode");
  2375. #ifndef keypad_xmit
  2376. #define keypad_xmit NULL
  2377. #endif
  2378.   (*func)(stream,"smkx",    "ks",    TSTRING, keypad_xmit,        do_start_keypad,    "do_start_keypad",    "enter keypad transmit mode");
  2379. #ifndef label_on
  2380. #define label_on NULL
  2381. #endif
  2382.   (*func)(stream,"smln",    "LO",    TSTRING, label_on,        do_enable_soft_labels,    "do_enable_soft_labels",    "Turn on soft labels");
  2383. #ifndef meta_on
  2384. #define meta_on NULL
  2385. #endif
  2386.   (*func)(stream,"smm",    "mm",    TSTRING, meta_on,        do_enter_meta_mode,    "do_enter_meta_mode",    "Enter Meta mode");
  2387. #ifndef enter_standout_mode
  2388. #define enter_standout_mode NULL
  2389. #endif
  2390.   (*func)(stream,"smso",    "so",    TSTRING, enter_standout_mode,    do_standout,    "do_standout",    "Enter standout mode");
  2391. #ifndef enter_underline_mode
  2392. #define enter_underline_mode NULL
  2393. #endif
  2394.   (*func)(stream,"smul",    "us",    TSTRING, enter_underline_mode,    do_underline,    "do_underline",    "Enter underline mode");
  2395. #ifndef enter_xon_mode
  2396. #define enter_xon_mode NULL
  2397. #endif
  2398.   (*func)(stream,"smxon",    "SX",    TSTRING, enter_xon_mode,    do_enter_xon_xoff_mode,    "do_enter_xon_xoff_mode",    "enter xon mode");
  2399. #ifndef clear_all_tabs
  2400. #define clear_all_tabs NULL
  2401. #endif
  2402.   (*func)(stream,"tbc",    "ct",    TSTRING, clear_all_tabs,    do_clear_tabs,    "do_clear_tabs",    "clear tab stops");
  2403. #ifndef to_status_line
  2404. #define to_status_line NULL
  2405. #endif
  2406.   (*func)(stream,"tsl",    "ts",    TSTRING, to_status_line,    do_go_to_status,    "do_go_to_status",    "Move column #1 in status line");
  2407. #ifndef underline_char
  2408. #define underline_char NULL
  2409. #endif
  2410.   (*func)(stream,"uc",    "uc",    TSTRING, underline_char,    do_underline_char,    "do_underline_char",    "Undersocore one char and move past it");
  2411. #ifndef row_address
  2412. #define row_address NULL
  2413. #endif
  2414.   (*func)(stream,"vpa",    "cv",    TSTRING, row_address,        do_set_cursor_row,    "do_set_cursor_row",    "Move to line N");
  2415. #ifndef set_window
  2416. #define set_window NULL
  2417. #endif
  2418.   (*func)(stream,"wind",    "wi",    TSTRING, set_window,    do_set_window,    "do_set_window",        "Current window is #1-#2 cols #3-#4");
  2419. #ifndef print_screen
  2420. #define print_screen NULL
  2421. #endif
  2422.   (*func)(stream,"mc0",        "ps",    TSTRING, print_screen,    do_print_screen,    "do_print_screen",        "print screen");
  2423. #ifndef prtr_off
  2424. #define prtr_off NULL
  2425. #endif
  2426.   (*func)(stream,"mc4",        "pf",    TSTRING, prtr_off,    do_printer_off,    "do_printer_off",        "turn printer off");
  2427. #ifndef prtr_on
  2428. #define prtr_on NULL
  2429. #endif
  2430.   (*func)(stream,"mc5",        "po",    TSTRING, prtr_on,    do_printer_on,    "do_printer_on",        "turn printer on");
  2431. #ifndef prtr_non
  2432. #define prtr_non NULL
  2433. #endif
  2434.   (*func)(stream,"mc5p",    "pO",    TSTRING, prtr_non,    do_print_nbytes,    "do_print_nbytes",        "turn printer on for N bytes");
  2435.  
  2436.   (*func)(stream,"NOOP",     "NOOP",    TSTRING, NULL,        do_nothing,        "do_nothing",        "");
  2437.   (*func)(stream,"VTMODES",  "VTMODES",    TSTRING, NULL,        do_VTModes,        "do_VTModes",        "");
  2438.  
  2439.   (*func)(stream,"HPDC2",  "HPDC2",    TSTRING, NULL,        do_HPDC2,        "do_HPDC2",        "");
  2440.   (*func)(stream,"HPSHAKE",  "HPSHAKE",    TSTRING, NULL,        do_HPSHAKE,        "do_HPSHAKE",        "");
  2441.   (*func)(stream,"HPBLOCK",  "HPBLOCK",    TSTRING, NULL,        do_HPBLOCKMODE,        "do_HPBLOCKMODE",        "");
  2442.   (*func)(stream,"HPPAGE",  "HPPAGE",    TSTRING, NULL,        do_HPPAGE,        "do_HPPAGE",        "");
  2443.   (*func)(stream,"HPNOPAGE",  "HPNOPAGE",    TSTRING, NULL,        do_HPNOPAGE,        "do_HPNOPAGE",        "");
  2444.   (*func)(stream,"HPPAGEMODE",  "HPPAGEMODE",    TSTRING, NULL,        do_HPPAGEMODE,        "do_HPPAGEMODE",        "");
  2445.   (*func)(stream,"HPEOLWRAP",  "HPEOLWRAP",    TSTRING, NULL,        do_HPEOLWRAP,        "do_HPEOLWRAP",        "");
  2446.   (*func)(stream,"HPSPOW",  "HPSPOW",    TSTRING, NULL,        do_HPSPOW,        "do_HPSPOW",        "");
  2447.   (*func)(stream,"HPXMITFUNS",  "HPXMITFUNS",    TSTRING, NULL,        do_HPXMITFUNS,        "do_HPXMITFUNS",        "");
  2448.   (*func)(stream,"HPAUTOKBDLOCK",  "HPAUTOKBDLOCK",    TSTRING, NULL,        do_HPAUTOKBDLOCK,        "do_HPAUTOKBDLOCK",        "");
  2449.   (*func)(stream,"HPAUTOLINEFEED",  "HPAUTOLINEFEED",    TSTRING, NULL,        do_HPAUTOLINEFEED,        "do_HPAUTOLINEFEED",        "");
  2450.   (*func)(stream,"HPCAPSLOCK",  "HPCAPSLOCK",    TSTRING, NULL,        do_HPCAPSLOCK,        "do_HPCAPSLOCK",        "");
  2451.   (*func)(stream,"HPKBDLOCK",  "HPKBDLOCK",    TSTRING, NULL,        do_HPKBDLOCK,        "do_HPKBDLOCK",        "");
  2452.   (*func)(stream,"HPKBDUNLOCK",  "HPKBDUNLOCK",    TSTRING, NULL,        do_HPKBDUNLOCK,        "do_HPKBDUNLOCK",        "");
  2453.   (*func)(stream,"HPMEMLOCK",  "HPMEMLOCK",    TSTRING, NULL,        do_HPMEMLOCK,        "do_HPMEMLOCK",        "");
  2454.   (*func)(stream,"HPMEMUNLOCK",  "HPMEMUNLOCK",    TSTRING, NULL,        do_HPMEMUNLOCK,        "do_HPMEMUNLOCK",        "");
  2455.   (*func)(stream,"HPFORMAT",  "HPFORMAT",    TSTRING, NULL,        do_HPFORMAT,        "do_HPFORMAT",        "");
  2456.   (*func)(stream,"HPNOFORMAT",  "HPNOFORMAT",    TSTRING, NULL,        do_HPNOFORMAT,        "do_HPNOFORMAT",        "");
  2457.   (*func)(stream,"HPDISPFUNS",  "HPDISPFUNS",    TSTRING, NULL,        do_HPDISPFUNS,        "do_HPDISPFUNS",        "");
  2458.   (*func)(stream,"HPNODISPFUNS",  "HPNODISPFUNS",    TSTRING, NULL,        do_HPNODISPFUNS,        "do_HPNODISPFUNS",        "");
  2459.   (*func)(stream,"HPSTATUS1",  "HPSTATUS1",    TSTRING, NULL,        do_HPSTATUS1,        "do_HPSTATUS1",        "");
  2460.   (*func)(stream,"HPSTATUS2",  "HPSTATUS2",    TSTRING, NULL,        do_HPSTATUS2,        "do_HPSTATUS2",        "");
  2461.   (*func)(stream,"HPDEVICEID",  "HPDEVICEID",    TSTRING, NULL,        do_HPDEVICEID,        "do_HPDEVICEID",        "");
  2462.   (*func)(stream,"HPMODES",  "HPMODES",    TSTRING, NULL,        do_HPMODES,        "do_HPMODES",        "");
  2463.   (*func)(stream,"HPKEYS",  "HPKEYS",    TSTRING, NULL,        do_HPKEYS,        "do_HPKEYS",        "");
  2464.   (*func)(stream,"HPNOKEYS",  "HPNOKEYS",    TSTRING, NULL,        do_HPNOKEYS,        "do_HPNOKEYS",        "");
  2465.   (*func)(stream,"HPAUTOTERM",  "HPAUTOTERM",    TSTRING, NULL,        do_HPAUTOTERM,        "do_HPAUTOTERM",        "");
  2466.   (*func)(stream,"HPCLEARTERM",  "HPCLEARTERM",    TSTRING, NULL,        do_HPCLEARTERM,        "do_HPCLEARTERM",        "");
  2467.   (*func)(stream,"HPATTR",  "HPATTR",    TSTRING, NULL,        do_HPATTR,        "do_HPATTR",        "");
  2468.  
  2469.   (*func)(stream,"CRNL",      "CRNL",    TSTRING, NULL,        do_CRNL_on,        "do_CRNL_on",        "");
  2470.   (*func)(stream,"NOCRNL",  "NOCRNL",    TSTRING, NULL,        do_CRNL_off,        "do_CRNL_off",        "");
  2471.   (*func)(stream,"ECHO",      "ECHO",    TSTRING, NULL,        do_ECHO_on,        "do_ECHO_on",        "");
  2472.   (*func)(stream,"NOECHO",  "NOECHO",    TSTRING, NULL,        do_ECHO_off,        "do_ECHO_off",        "");
  2473.   (*func)(stream,"TABSPACE","TABSPACE",    TSTRING, NULL,        do_TABSPACE_on,        "do_TABSPACE_on",    "");
  2474.   (*func)(stream,"NOTABSPACE","NOTABSPACE",TSTRING, NULL,        do_TABSPACE_off,    "do_TABSPACE_off",    "");
  2475.  
  2476.  
  2477.   (*func)(stream,"CLRLN",     "CLRLN",    TSTRING, NULL,        do_clear_line,        "do_clear_line",    "");
  2478.   (*func)(stream,"CLR2BOS", "CLR2BOS",    TSTRING, NULL,        do_clear_to_bos,    "do_clear_to_bos",    "");
  2479.   (*func)(stream,"NOALTCHR", "NOALTCHR",    TSTRING, NULL,    do_disable_altchar_mode,"do_disable_altchar_mode",    "");
  2480.   (*func)(stream,"NOBLINK",  "NOBLINK",    TSTRING, NULL,        do_noblink,        "do_noblink",        "");
  2481.   (*func)(stream,"NOBOLD",   "NOBOLD",    TSTRING, NULL,        do_nobold,        "do_nobold",        "");
  2482.   (*func)(stream,"NODIM",    "NODIM",    TSTRING, NULL,        do_nodim,        "do_nodim",        "");
  2483.   (*func)(stream,"NOSTATLN", "NOSTATLN",    TSTRING, NULL,        do_nodisplay_status,    "do_nodisplay_status",    "");
  2484.   (*func)(stream,"NOPROTECT","NOPROTECT",    TSTRING, NULL,        do_noprotect,        "do_noprotect",        "");
  2485.   (*func)(stream,"NOREVERSE","NOREVERSE",    TSTRING, NULL,        do_noreverse,        "do_noreverse",        "");
  2486.   (*func)(stream,"NOWRAP",     "NOWRAP",    TSTRING, NULL,        do_nowrap,        "do_nowrap",        "");
  2487.   (*func)(stream,"WRAP",     "WRAP",    TSTRING, NULL,        do_wrap,        "do_wrap",        "");
  2488. };
  2489.  
  2490.  
  2491.  
  2492.